/* ===========================
   NetHR — Modern UI
   =========================== */

/* --- Değişkenler --- */
:root {
  --sidebar-w:            240px;
  --sidebar-bg:           #0f4c81;
  --sidebar-text:         rgba(255,255,255,0.80);
  --sidebar-hover:        rgba(255,255,255,.07);
  --sidebar-active-bg:    rgba(255,255,255,0.20);
  --sidebar-active-text:  #ffffff;
  --topbar-h:             56px;

  --primary:        #0f4c81;
  --primary-hover:  #1a6eb5;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  --bg:       #f0f4f8;
  --surface:  #ffffff;
  --border:   #e2e8f0;
  --text:     #0f172a;
  --muted:    #64748b;

  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 12px rgba(0,0,0,.08);
}

/* --- Temel --- */
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* ===========================
   App Shell — Sidebar Layout
   =========================== */
.app-wrapper { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f4c81 0%, #1a6eb5 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.2px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand:hover { color: #fff; }

.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: .72rem;
  font-weight: 800;
  color: white;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.sidebar-section-label {
  padding: 14px 16px 4px;
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.25);
}

.sidebar-nav {
  list-style: none;
  margin: 6px 0;
  padding: 0 8px;
  flex: 1;
}

.sidebar-nav .nav-item { margin: 2px 0; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: .855rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.nav-icon {
  font-size: .95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: .7rem;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-name {
  font-size: .78rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: var(--sidebar-text);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: .72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-logout:hover { border-color: rgba(255,255,255,.4); color: #e2e8f0; }

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* --- Top Bar --- */
.top-bar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-date {
  margin-left: auto;
  font-size: .78rem;
  color: var(--muted);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}

/* --- Page Content --- */
.page-content {
  padding: 22px 24px;
  flex: 1;
}

.app-footer {
  padding: 14px 24px;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ===========================
   Components
   =========================== */

/* --- Stat Cards --- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  height: 100%;
}

.stat-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; }
.stat-icon.green  { background: #f0fdf4; }
.stat-icon.purple { background: #faf5ff; }
.stat-icon.amber  { background: #fffbeb; }

.stat-value    { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-value-sm { font-size: 1.2rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-label    { font-size: .78rem; color: var(--muted); margin-top: 3px; }

.stat-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* --- Cards --- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0 !important;
  padding: 13px 18px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

/* Renkli card header'lar */
.card-header-dark    { background: var(--sidebar-bg) !important; color: white; border-bottom: none !important; }
.card-header-success { background: var(--success)    !important; color: white; border-bottom: none !important; }
.card-header-warning { background: var(--warning)    !important; color: #0f172a; border-bottom: none !important; }
.card-header-muted   { background: #475569           !important; color: white; border-bottom: none !important; }

.card-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) !important;
  padding: 10px 18px;
  font-size: .82rem;
  color: var(--muted);
}

/* --- Tables --- */
.table { font-size: .855rem; }

.table thead th {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: #f8fafc;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border) !important;
  white-space: nowrap;
}

/* Bootstrap table-dark override → açık tema */
.table-dark {
  --bs-table-bg: #f8fafc !important;
  --bs-table-color: var(--muted) !important;
  --bs-table-border-color: var(--border) !important;
}
.table-dark th { color: var(--muted) !important; }

.table td { padding: 10px 14px; vertical-align: middle; }
.table-hover > tbody > tr:hover > td { background-color: #f8fafc; }
.table-secondary { --bs-table-bg: #f1f5f9; }

/* --- Buttons --- */
.btn {
  font-weight: 500;
  border-radius: 7px;
  font-size: .84rem;
  transition: all .15s;
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #059669; border-color: #059669; }

.btn-outline-secondary {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface);
}
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }

.btn-outline-danger { color: var(--danger); border-color: #fca5a5; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* --- Forms --- */
.form-control, .form-select {
  border-radius: 7px;
  border-color: var(--border);
  font-size: .875rem;
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-label  { font-size: .875rem; font-weight: 500; color: var(--text); }
.form-text   { font-size: .78rem; }
.input-group-text {
  border-color: var(--border);
  background: #f8fafc;
  font-size: .875rem;
  color: var(--muted);
}

/* --- Badges --- */
.badge {
  border-radius: 5px;
  font-weight: 500;
  font-size: .71rem;
  letter-spacing: .01em;
}

/* --- Alerts --- */
.alert { border-radius: var(--radius); border: none; font-size: .875rem; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }

/* --- Progress --- */
.progress { border-radius: 99px; background: #e2e8f0; }
.progress-bar { border-radius: 99px; background: var(--primary); }

/* --- List Group --- */
.list-group-item { border-color: var(--border); }

/* --- Page Heading --- */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-heading h4, .page-heading h5 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

/* ===========================
   Mavi Tablo Başlığı
   =========================== */
.table-hr thead th,
.table-hr thead td {
  background-color: #e8f4fd !important;
  color: #0f4c81 !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.78rem;
}

/* Net maaş sütunu */
.col-net-salary {
  color: #198754 !important;
  font-weight: 700 !important;
}

/* Durum pill badge'leri */
.badge-pill-success {
  background: #d1fae5;
  color: #065f46;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pill-danger {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pill-warning {
  background: #fef9c3;
  color: #854d0e;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Yön kartları (Calculate sayfası) */
.direction-card--active {
  background: linear-gradient(135deg, #0f4c81, #1a6eb5);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,76,129,0.35);
}
.direction-card--inactive {
  background: #fff;
  border: 2px dashed #0f4c81;
  color: #0f4c81;
}

/* ===========================
   Mobile / Responsive
   =========================== */
@media (max-width: 991.98px) {
  .sidebar            { transform: translateX(-100%); }
  .sidebar.open       { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .sidebar-toggle     { display: inline-flex; align-items: center; }
  .main-content       { margin-left: 0; }
}
