/* ═══════════════════════════════════════════════════════════════════════════
   ADANA EKSPRES — CRM Internal Platform
   Dark sidebar shell · Amber accents · Clean data-dense layout
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --amber:      #D4580A;
  --amber-dk:   #A63E06;
  --amber-lt:   rgba(212,88,10,0.12);
  --amber-glow: rgba(212,88,10,0.20);

  --char:       #111418;
  --char-mid:   #181E28;
  --char-lt:    #1F2737;
  --char-rule:  #2A3547;
  --char-muted: #4A5568;

  --sidebar-w:  240px;
  --topbar-h:   56px;

  --white:      #FFFFFF;
  --bg:         #F0F2F5;
  --surface:    #FFFFFF;
  --border:     #E2E8F0;
  --text:       #1A202C;
  --muted:      #718096;

  --green:      #38A169;
  --green-lt:   rgba(56,161,105,0.12);
  --blue:       #3182CE;
  --blue-lt:    rgba(49,130,206,0.12);
  --red:        #E53E3E;
  --red-lt:     rgba(229,62,62,0.12);
  --yellow:     #D69E2E;
  --yellow-lt:  rgba(214,158,46,0.12);

  --font:       'Instrument Sans', system-ui, sans-serif;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --ease:       cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { -webkit-font-smoothing:antialiased; }
body { font-family:var(--font); font-size:14px; line-height:1.6; color:var(--text); background:var(--bg); }
a    { color:inherit; text-decoration:none; }
img  { max-width:100%; display:block; }
button { cursor:pointer; font-family:var(--font); }
input,select,textarea { font-family:var(--font); }

/* ── App Shell ────────────────────────────────────────────────────────────── */
.app-shell { display:flex; min-height:100vh; }

.app-main {
  flex:1;
  margin-left:var(--sidebar-w);
  display:flex;
  flex-direction:column;
  min-height:100vh;
  transition:margin-left .25s var(--ease);
}

.app-content {
  flex:1;
  padding:28px 32px;
  max-width:1440px;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  position:fixed;
  top:0; left:0;
  width:var(--sidebar-w);
  height:100vh;
  background:var(--char);
  display:flex;
  flex-direction:column;
  z-index:100;
  overflow-y:auto;
  overflow-x:hidden;
  transition:transform .25s var(--ease);
}

.sidebar-brand {
  display:flex;
  align-items:center;
  gap:12px;
  padding:20px 16px 16px;
  border-bottom:1px solid var(--char-rule);
}

.brand-icon {
  width:40px; height:40px;
  background:var(--amber);
  color:#fff;
  border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px;
  letter-spacing:.05em;
  flex-shrink:0;
}
.brand-icon.lg { width:52px; height:52px; font-size:16px; border-radius:12px; }

.brand-text { display:flex; flex-direction:column; }
.brand-name { font-size:13px; font-weight:700; color:#fff; letter-spacing:.02em; }
.brand-sub  { font-size:10.5px; color:var(--char-muted); letter-spacing:.04em; text-transform:uppercase; }

.sidebar-nav { flex:1; padding:12px 0; }

.nav-section {
  font-size:10px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--char-muted);
  padding:16px 18px 6px;
}

.nav-item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 18px;
  color:rgba(255,255,255,0.6);
  font-size:13px;
  font-weight:500;
  border-radius:0;
  transition:all .15s var(--ease);
  position:relative;
}
.nav-item i { width:16px; text-align:center; font-size:13px; flex-shrink:0; }
.nav-item:hover { color:#fff; background:rgba(255,255,255,0.06); }
.nav-item.active {
  color:#fff;
  background:var(--amber-lt);
  border-left:3px solid var(--amber);
  padding-left:15px;
}
.nav-item.active i { color:var(--amber); }

.nav-badge {
  margin-left:auto;
  background:var(--amber);
  color:#fff;
  font-size:10px;
  font-weight:700;
  min-width:18px; height:18px;
  border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  padding:0 5px;
}

.sidebar-footer {
  padding:14px 16px;
  border-top:1px solid var(--char-rule);
}

.sidebar-user {
  display:flex;
  align-items:center;
  gap:10px;
}

.user-avatar {
  width:34px; height:34px;
  background:var(--amber);
  color:#fff;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px;
  flex-shrink:0;
}
.user-avatar.sm { width:28px; height:28px; font-size:11px; }

.user-info { display:flex; flex-direction:column; min-width:0; }
.user-name  { font-size:13px; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role  { font-size:11px; color:var(--char-muted); text-transform:capitalize; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  height:var(--topbar-h);
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  padding:0 24px;
  gap:16px;
  position:sticky;
  top:0;
  z-index:50;
}

.sidebar-toggle {
  display:none;
  background:none;
  border:none;
  color:var(--muted);
  font-size:16px;
  padding:4px;
}

.topbar-breadcrumb { flex:1; font-size:13px; color:var(--muted); }
.topbar-right { display:flex; align-items:center; gap:12px; }

.topbar-alert {
  display:flex; align-items:center; gap:6px;
  background:var(--red-lt);
  color:var(--red);
  font-size:12px; font-weight:600;
  padding:4px 10px;
  border-radius:20px;
  cursor:pointer;
}

.topbar-user { position:relative; }
.user-btn {
  display:flex; align-items:center; gap:8px;
  background:none; border:none;
  color:var(--text); font-size:13px; font-weight:500;
  padding:6px 8px; border-radius:var(--radius);
  transition:background .15s;
}
.user-btn:hover { background:var(--bg); }
.user-btn i { font-size:10px; color:var(--muted); }

.dropdown-menu {
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  min-width:200px;
  z-index:200;
  overflow:hidden;
}
.dropdown-header { padding:12px 16px; border-bottom:1px solid var(--border); }
.dropdown-header strong { display:block; font-size:13px; }
.dropdown-header span   { font-size:12px; color:var(--muted); text-transform:capitalize; }
.dropdown-divider { height:1px; background:var(--border); }
.dropdown-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 16px;
  font-size:13px; color:var(--text);
  transition:background .12s;
}
.dropdown-item:hover { background:var(--bg); }
.dropdown-item i { width:14px; text-align:center; }
.text-danger { color:var(--red) !important; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:24px;
  gap:16px;
}
.page-title { font-size:22px; font-weight:700; color:var(--text); }
.page-sub   { font-size:13px; color:var(--muted); margin-top:2px; }
.page-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }

.badge-role {
  font-size:11px; font-weight:600;
  letter-spacing:.06em; text-transform:capitalize;
  background:var(--amber-lt);
  color:var(--amber);
  padding:4px 12px;
  border-radius:20px;
}

/* ── Stat grid ────────────────────────────────────────────────────────────── */
.stat-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
  gap:16px;
  margin-bottom:24px;
}

.stat-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:20px;
  display:flex;
  align-items:center;
  gap:16px;
  box-shadow:var(--shadow);
  transition:box-shadow .2s;
}
.stat-card:hover { box-shadow:var(--shadow-md); }

.stat-icon {
  width:44px; height:44px;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.stat-icon.amber { background:var(--amber-lt); color:var(--amber); }
.stat-icon.green { background:var(--green-lt);  color:var(--green); }
.stat-icon.blue  { background:var(--blue-lt);   color:var(--blue); }
.stat-icon.red   { background:var(--red-lt);    color:var(--red); }

.stat-body { display:flex; flex-direction:column; min-width:0; }
.stat-label { font-size:12px; color:var(--muted); font-weight:500; }
.stat-value { font-size:26px; font-weight:700; color:var(--text); line-height:1.2; }

/* ── Panel grid ───────────────────────────────────────────────────────────── */
.panel-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));
  gap:16px;
}

.panel {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.panel-header {
  padding:16px 20px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.panel-header h3 { font-size:14px; font-weight:600; }
.panel-body { padding:20px; }

/* ── Quick links ──────────────────────────────────────────────────────────── */
.quick-links { display:flex; flex-wrap:wrap; gap:8px; }
.quick-link {
  display:inline-flex; align-items:center; gap:7px;
  background:var(--bg);
  border:1px solid var(--border);
  color:var(--text);
  font-size:13px; font-weight:500;
  padding:8px 14px;
  border-radius:var(--radius);
  transition:all .15s var(--ease);
}
.quick-link:hover {
  background:var(--amber-lt);
  border-color:var(--amber-glow);
  color:var(--amber);
}
.quick-link i { font-size:11px; }

/* ── Status rows ──────────────────────────────────────────────────────────── */
.status-row { display:flex; align-items:center; gap:10px; padding:6px 0; font-size:13px; }
.status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.status-dot.green  { background:var(--green); }
.status-dot.amber  { background:var(--amber); }
.status-dot.red    { background:var(--red); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 20px;
  font-size:13.5px; font-weight:600;
  border-radius:var(--radius);
  border:1.5px solid transparent;
  transition:all .15s var(--ease);
  cursor:pointer; white-space:nowrap;
}
.btn-primary { background:var(--amber); color:#fff; border-color:var(--amber); }
.btn-primary:hover { background:var(--amber-dk); border-color:var(--amber-dk); }
.btn-secondary { background:var(--bg); color:var(--text); border-color:var(--border); }
.btn-secondary:hover { border-color:var(--amber); color:var(--amber); }
.btn-danger { background:var(--red-lt); color:var(--red); border-color:transparent; }
.btn-danger:hover { background:var(--red); color:#fff; }
.btn-full { width:100%; justify-content:center; }
.btn-sm { padding:6px 14px; font-size:12.5px; }
.btn-lg { padding:12px 28px; font-size:15px; }
.btn i { font-size:12px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.form-group label,
.form-label {
  font-size:13px; font-weight:600; color:var(--text);
}
.form-group label .req { color:var(--amber); margin-left:2px; }

/* Base field styles — covers both class-based and type-based selectors */
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel],
input[type=url], input[type=search], input[type=time],
input[type=month], input[type=week],
select, textarea,
.form-input {
  width:100%;
  padding:9px 12px;
  font-size:13.5px;
  line-height:1.5;
  border:1.5px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--text);
  transition:border-color .15s, box-shadow .15s;
  outline:none;
  font-family:var(--font);
}

/* Inputs without an explicit type (defaults to text) */
input:not([type]):not([class*="btn"]) {
  width:100%;
  padding:9px 12px;
  font-size:13.5px;
  line-height:1.5;
  border:1.5px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface);
  color:var(--text);
  transition:border-color .15s, box-shadow .15s;
  outline:none;
  font-family:var(--font);
}

input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=number]:focus, input[type=date]:focus, input[type=tel]:focus,
input[type=url]:focus, input[type=search]:focus, input[type=time]:focus,
input[type=month]:focus, input[type=week]:focus,
input:not([type]):focus,
select:focus, textarea:focus,
.form-input:focus {
  border-color:var(--amber);
  box-shadow:0 0 0 3px var(--amber-lt);
}

input[type=text]::placeholder, input[type=email]::placeholder,
input[type=password]::placeholder, input[type=number]::placeholder,
input[type=tel]::placeholder, input[type=url]::placeholder,
input[type=search]::placeholder, input:not([type])::placeholder,
textarea::placeholder, .form-input::placeholder {
  color:var(--muted);
  opacity:1;
}

textarea, textarea.form-input { resize:vertical; min-height:100px; }

select, select.form-input {
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:36px;
  cursor:pointer;
}

/* Card wrapper with a footer action row */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); overflow:hidden; }
.card-body { padding:20px 24px; }
.card-footer { padding:14px 24px; background:var(--bg); border-top:1px solid var(--border); }

.form-hint  { font-size:11.5px; color:var(--muted); }
.form-error { font-size:11.5px; color:var(--red); }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash {
  display:flex; align-items:center; gap:10px;
  padding:12px 16px;
  border-radius:var(--radius);
  font-size:13.5px; font-weight:500;
  margin-bottom:20px;
}
.flash-success { background:var(--green-lt); color:var(--green); }
.flash-error   { background:var(--red-lt);   color:var(--red); }
.flash-info    { background:var(--blue-lt);  color:var(--blue); }
.flash-warning { background:var(--yellow-lt); color:var(--yellow); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x:auto; border-radius:var(--radius-lg); border:1px solid var(--border); }
table { width:100%; border-collapse:collapse; background:var(--surface); font-size:13px; }
thead th {
  padding:11px 16px;
  text-align:left;
  font-size:11px; font-weight:700;
  letter-spacing:.07em; text-transform:uppercase;
  color:var(--muted);
  background:var(--bg);
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
tbody td { padding:12px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:rgba(0,0,0,0.015); }
td .actions { display:flex; gap:6px; }

/* ── Badges / status pills ────────────────────────────────────────────────── */
.pill {
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 10px; border-radius:20px;
  font-size:11.5px; font-weight:600;
  white-space:nowrap;
}
.pill-green  { background:var(--green-lt);  color:var(--green); }
.pill-amber  { background:var(--amber-lt);  color:var(--amber); }
.pill-blue   { background:var(--blue-lt);   color:var(--blue); }
.pill-red    { background:var(--red-lt);    color:var(--red); }
.pill-yellow { background:var(--yellow-lt); color:var(--yellow); }
.pill-gray   { background:var(--bg);        color:var(--muted); border:1px solid var(--border); }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-body {
  background:var(--char);
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
}

.login-wrap {
  width:100%; max-width:400px;
  display:flex; flex-direction:column; gap:24px;
}

.login-brand {
  display:flex; align-items:center; gap:16px;
  color:#fff;
}
.login-brand h1 { font-size:22px; font-weight:700; }
.login-brand p  { font-size:12px; color:var(--char-muted); margin-top:2px; text-transform:uppercase; letter-spacing:.08em; }

.login-card {
  background:var(--char-lt);
  border:1px solid var(--char-rule);
  border-radius:var(--radius-lg);
  padding:32px;
}
.login-card h2 { font-size:18px; font-weight:700; color:#fff; margin-bottom:4px; }
.login-sub     { font-size:12.5px; color:var(--char-muted); margin-bottom:24px; }

.login-form { display:flex; flex-direction:column; gap:4px; }
.login-form .form-group label { color:rgba(255,255,255,0.7); }
.login-form input {
  background:var(--char-mid);
  border-color:var(--char-rule);
  color:#fff;
}
.login-form input::placeholder { color:var(--char-muted); }
.login-form input:focus { border-color:var(--amber); background:var(--char-mid); }
.login-form .btn-primary { margin-top:8px; padding:11px 20px; font-size:14px; }

.login-footer { font-size:11.5px; color:var(--char-muted); text-align:center; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.mt-4 { margin-top:24px; }
.mt-2 { margin-top:12px; }
.mb-4 { margin-bottom:24px; }
.text-muted { color:var(--muted); }
.text-amber { color:var(--amber); }
.text-red   { color:var(--red);   }
.text-right { text-align:right; }
.text-center { text-align:center; }
.tab-count { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:9px; font-size:10px; font-weight:700; background:var(--border); color:var(--muted); }
.fw-600 { font-weight:600; }
.fw-700 { font-weight:700; }
.d-flex { display:flex; }
.align-center { align-items:center; }
.gap-2 { gap:8px; }
.gap-3 { gap:12px; }

/* ── Sidebar overlay (mobile backdrop) ────────────────────────────────────── */
.sidebar-overlay {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:99;             /* just below sidebar (z-index 100) */
  backdrop-filter:blur(1px);
  -webkit-backdrop-filter:blur(1px);
  animation:fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* Sidebar close button — only rendered on mobile */
.sidebar-close {
  display:none;
  position:absolute;
  top:14px; right:14px;
  background:rgba(255,255,255,0.08);
  border:none;
  color:rgba(255,255,255,0.6);
  width:30px; height:30px;
  border-radius:6px;
  font-size:14px;
  align-items:center; justify-content:center;
  transition:background .15s, color .15s;
}
.sidebar-close:hover { background:rgba(255,255,255,0.15); color:#fff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform:translateX(-100%);
  }
  .sidebar.open {
    transform:translateX(0);
    box-shadow:var(--shadow-lg);
    z-index:200;
  }
  body.sidebar-open .sidebar-overlay {
    display:block;
  }
  .sidebar-close {
    display:flex;
  }
  .app-main { margin-left:0; }
  .sidebar-toggle { display:block; }
  .app-content { padding:20px 16px; }
  .stat-grid { grid-template-columns:repeat(auto-fill, minmax(160px,1fr)); }
  .page-header { flex-wrap:wrap; }
}
