/* ═══════════════════════════════════════════════
   AEF DESTEK - Ortak Stiller
   ═══════════════════════════════════════════════ */

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

:root {
  --navy:       #1a2b5e;
  --navy-dark:  #111e45;
  --navy-light: #2a3f7e;
  --red:        #c8102e;
  --red-dark:   #a50d26;
  --red-light:  rgba(200,16,46,0.08);
  --gold:       #f5a623;
  --bg:         #f4f6fb;
  --white:      #ffffff;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --border2:    #cbd5e1;
  --text:       #1e293b;
  --text2:      #475569;
  --text3:      #94a3b8;
  --green:      #16a34a;
  --green-dim:  #dcfce7;
  --yellow:     #d97706;
  --yellow-dim: #fef3c7;
  --blue-dim:   #dbeafe;
  --blue:       #2563eb;
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --radius:     10px;
  --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);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── LAYOUT ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-text .top {
  font-size: 11px; font-weight: 700; color: #fff;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.sidebar-logo-text .bot {
  font-size: 10px; color: rgba(255,255,255,0.5);
}

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em; text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav a .nav-icon { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.5);
  text-decoration: none; font-size: 13px;
  transition: all 0.15s;
}
.sidebar-footer a:hover { background: rgba(255,255,255,0.08); color: var(--red); }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-light);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info .role {
  font-size: 10px; color: rgba(255,255,255,0.45);
}

/* ── MAIN AREA ── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.page-sub   { font-size: 12px; color: var(--text3); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 20px; }

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.stat-icon.navy   { background: rgba(26,43,94,0.1);  }
.stat-icon.red    { background: var(--red-light);     }
.stat-icon.green  { background: var(--green-dim);     }
.stat-icon.yellow { background: var(--yellow-dim);    }
.stat-icon.blue   { background: var(--blue-dim);      }

.stat-num  { font-size: 24px; font-weight: 700; color: var(--navy); display: block; line-height: 1; }
.stat-lbl  { font-size: 12px; color: var(--text3); margin-top: 2px; display: block; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}

table.data-table thead tr th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em;
  background: #f8fafc; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table tbody tr td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: #f8fafc; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}

.badge-open     { background: var(--blue-dim);   color: var(--blue);   }
.badge-progress { background: var(--yellow-dim); color: var(--yellow); }
.badge-closed   { background: var(--green-dim);  color: var(--green);  }
.badge-high     { background: var(--red-light);  color: var(--red);    }
.badge-medium   { background: var(--yellow-dim); color: var(--yellow); }
.badge-low      { background: var(--green-dim);  color: var(--green);  }
.badge-admin    { background: rgba(26,43,94,0.1); color: var(--navy);  }
.badge-support  { background: var(--blue-dim);   color: var(--blue);   }
.badge-customer { background: #f1f5f9;           color: var(--text2);  }
.badge-active   { background: var(--green-dim);  color: var(--green);  }
.badge-inactive { background: #f1f5f9;           color: var(--text3);  }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: none;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary   { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); box-shadow: 0 4px 12px rgba(26,43,94,0.3); }

.btn-red       { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); box-shadow: 0 4px 12px rgba(200,16,46,0.3); }

.btn-outline {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover { border-color: var(--navy); background: rgba(26,43,94,0.04); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text2); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--navy); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-label span { color: var(--red); }

.form-control {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border2); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 13px;
  color: var(--text); background: var(--white);
  outline: none; transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,43,94,0.08); }
.form-control::placeholder { color: var(--text3); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: var(--red-light); color: var(--red); border: 1px solid rgba(200,16,46,0.2); }
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(22,163,74,0.2); }
.alert-info    { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(37,99,235,0.2); }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text3); margin-bottom: 20px;
}
.breadcrumb a { color: var(--navy); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text3); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text3);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ── PRIORITY DOT ── */
.priority-dot {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
}
.priority-dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.priority-dot.high::before   { background: var(--red); }
.priority-dot.medium::before { background: var(--yellow); }
.priority-dot.low::before    { background: var(--green); }

/* ── MOBILE TOPBAR TOGGLE ── */
.mobile-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 6px; color: var(--navy);
  font-size: 20px; line-height: 1;
}
.mobile-menu-btn:hover { background: var(--bg); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.4);
}
.sidebar-overlay.show { display: block; }

/* ── TABLE: prevent horizontal scroll ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data-table { min-width: 0; }

/* hide less important columns on mobile */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  /* Main */
  .main-area { margin-left: 0; }

  /* Topbar */
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 14px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card  { padding: 12px 14px; gap: 10px; }
  .stat-icon  { width: 36px; height: 36px; font-size: 16px; }
  .stat-num   { font-size: 20px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Table: hide some columns */
  table.data-table thead th.hide-mobile,
  table.data-table tbody td.hide-mobile { display: none; }

  /* Topbar right — hide secondary buttons */
  .topbar-right .btn-outline { display: none; }

  /* Card header wrap */
  .card-header { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}
