/* ============================================================
   Domain Takip Sistemi — Modern UI
   Font: Inter | Icons: Font Awesome 6
   Theme: White + Navy Blue Sidebar
   ============================================================ */

:root {
  --navy:        #1a2e4a;
  --sidebar-bg:  #111827;
  --navy-hover:  #142238;
  --navy-light:  #243b55;
  --accent:      #2563eb;
  --accent-hover:#1d4ed8;
  --accent-soft: #eff6ff;
  --bg:          #f4f6fb;
  --white:       #ffffff;
  --border:      #e5e9f0;
  --text-dark:   #0f172a;
  --text-mid:    #475569;
  --text-muted:  #94a3b8;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.12);
  --sidebar-w:   248px;
  --topbar-h:    64px;
  --transition:  .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }


/* SVG ICONS */
.svg-icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; pointer-events: none; }

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

/* ═══════════════════ SIDEBAR ═══════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg, #111827);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 300;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

.sidebar-brand-name {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
  flex: 1;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.sidebar-close-btn:hover { color: #fff; }

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  padding: 16px 18px 6px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 2px 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.62);
  font-size: .93rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(37,99,235,.25);
  color: #fff;
  font-weight: 600;
}

.nav-item.active .nav-icon { color: #60a5fa; }

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: .9rem;
  flex-shrink: 0;
  color: rgba(255,255,255,.45);
  transition: color var(--transition);
}

.nav-item:hover .nav-icon { color: rgba(255,255,255,.8); }

.nav-active-bar {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}

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

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 2px;
}

.sidebar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-name { font-size: .82rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.4); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-logout:hover { background: rgba(239,68,68,.15); color: #fca5a5; text-decoration: none; }
.sidebar-logout i { width: 18px; text-align: center; font-size: .85rem; }

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

/* ═══════════════════ MAIN CONTENT ═══════════════════ */
.main-content {
  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;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-mid);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.topbar-menu-btn:hover { background: var(--bg); }

.topbar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.title-icon {
  color: var(--accent);
  font-size: .95rem;
}

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

/* ═══════════════════ CONTENT WRAP ═══════════════════ */
.content-wrap { padding: 28px; flex: 1; }

/* ═══════════════════ BUTTONS ═══════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .845rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--sidebar-bg, #111827);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }

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

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--sidebar-bg, #111827); color: #fff; }

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

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-danger-soft {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger-soft:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }

.btn-sm { padding: 6px 13px; font-size: .79rem; }
.btn-xs { padding: 4px 9px; font-size: .74rem; border-radius: 5px; }
.btn-block { width: 100%; justify-content: center; }

/* ═══════════════════ CARDS ═══════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  background: var(--white);
}

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

.card-title i { color: var(--accent); font-size: .85rem; }

.card-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card-body { padding: 22px; }
.card-body.p-0 { padding: 0; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* ═══════════════════ ALERTS / FLASH ═══════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: .845rem;
  font-weight: 500;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.flash-alert {
  margin: 16px 28px -12px;
  position: relative;
}
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  font-size: .85rem;
  padding: 2px;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ═══════════════════ FORMS ═══════════════════ */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  letter-spacing: .1px;
}

.required { color: #dc2626; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
.form-row .flex-1 { flex: 1; }
.form-row .flex-2 { flex: 2; }
.form-row .flex-3 { flex: 3; }

.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title i { color: var(--accent); }

.form-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .845rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  margin: 0;
}
.checkbox-label input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 3px;
}

.checkbox-list { display: flex; flex-direction: column; gap: 11px; }

/* ═══════════════════ TABLES ═══════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
}

.table th {
  text-align: left;
  padding: 11px 18px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-dark);
}

.table tbody tr:hover td { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table-sm td, .table-sm th { padding: 8px 14px; }

/* ═══════════════════ BADGES ═══════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-primary   { background: #eff6ff; color: #1e40af; }
.badge-info      { background: #f0f9ff; color: #075985; }
.badge-success   { background: #f0fdf4; color: #166534; }
.badge-warning   { background: #fffbeb; color: #92400e; }
.badge-yellow    { background: #fefce8; color: #854d0e; }
.badge-danger    { background: #fef2f2; color: #991b1b; }
.badge-secondary { background: #f8fafc; color: #475569; border: 1px solid var(--border); }
.badge-navy      { background: var(--sidebar-bg, #111827); color: #fff; }

/* ═══════════════════ DASHBOARD STATS ═══════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid #e9edf3;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  opacity: 0;
  transition: opacity .18s;
}
.stat-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
  transform: translateY(-3px);
  border-color: #d0d7e3;
  text-decoration: none;
  color: var(--text-dark);
}
.stat-card:hover::before { opacity: 1; }

.stat-card-blue::before   { background: #2563eb; }
.stat-card-red::before    { background: #dc2626; }
.stat-card-orange::before { background: #ea580c; }
.stat-card-yellow::before { background: #ca8a04; }
.stat-card-green::before  { background: #16a34a; }
.stat-card-gray::before   { background: #64748b; }
.stat-card-teal::before   { background: #0d9488; }

.stat-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -1.5px;
}

.stat-card-red .stat-number    { color: #dc2626; }
.stat-card-orange .stat-number { color: #ea580c; }
.stat-card-yellow .stat-number { color: #b45309; }
.stat-card-teal .stat-number   { color: #0d9488; }

.stat-card-label {
  font-size: .78rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
  letter-spacing: -.1px;
}
.stat-card-sub {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon-wrap .svg-icon { width: 18px; height: 18px; }

.stat-icon-blue   { background: #eff6ff; color: #2563eb; }
.stat-icon-red    { background: #fef2f2; color: #dc2626; }
.stat-icon-orange { background: #fff7ed; color: #ea580c; }
.stat-icon-yellow { background: #fefce8; color: #ca8a04; }
.stat-icon-green  { background: #f0fdf4; color: #16a34a; }
.stat-icon-gray   { background: #f8fafc; color: #64748b; }
.stat-icon-purple { background: #faf5ff; color: #7c3aed; }
.stat-icon-teal   { background: #f0fdfa; color: #0d9488; }

/* ═══════════════════ QUICK FILTERS ═══════════════════ */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.qfilter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .77rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  background: var(--white);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.qfilter:hover, .qfilter.active { text-decoration: none; color: #fff; border-color: transparent; }
.qf-danger:hover,  .qf-danger.active  { background: #dc2626; }
.qf-warning:hover, .qf-warning.active { background: #ea580c; }
.qf-yellow:hover,  .qf-yellow.active  { background: #ca8a04; }
.qf-info:hover,    .qf-info.active    { background: var(--accent); }
.qf-gray:hover,    .qf-gray.active    { background: #475569; }
.qf-purple:hover,  .qf-purple.active  { background: #7c3aed; }

/* ═══════════════════ SEARCH / FILTER BAR ═══════════════════ */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-row .form-group { margin-bottom: 0; }
.filter-search { flex: 2; min-width: 200px; }
.filter-select { flex: 1; min-width: 150px; }

.search-input-wrap { position: relative; }
.search-input-wrap .form-control { padding-left: 36px; }
.search-input-wrap > .svg-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  width: 15px;
  height: 15px;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap > .svg-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  width: 15px;
  height: 15px;
}
.input-icon-wrap .form-control { padding-left: 34px; }

/* ═══════════════════ DOMAIN LINK ═══════════════════ */
.domain-name-link {
  font-weight: 700;
  color: var(--navy);
  font-size: .9rem;
  transition: color var(--transition);
}
.domain-name-link:hover { color: var(--accent); }

.domain-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════ ACTION BUTTONS ═══════════════════ */
.actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  font-size: .8rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-icon:hover { background: var(--sidebar-bg, #111827); color: #fff; border-color: var(--navy); }
.btn-icon.danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-icon.accent:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════ MOBILE CARDS ═══════════════════ */
.domain-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.domain-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}

.domain-card-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 7px; }
.dc-row { display: flex; gap: 8px; align-items: flex-start; }
.dc-label { font-size: .73rem; font-weight: 600; color: var(--text-muted); min-width: 90px; flex-shrink: 0; }
.dc-value { font-size: .8rem; color: var(--text-dark); }
.domain-card-footer { padding: 10px 16px; border-top: 1px solid #f1f5f9; display: flex; gap: 7px; flex-wrap: wrap; background: #fafbfc; }

.hide-mobile { display: block; }
.show-mobile { display: none; }

/* ═══════════════════ PAGINATION ═══════════════════ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; }
.page-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  background: var(--sidebar-bg, #111827); color: #fff;
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}
.page-link:hover { background: var(--navy-hover); color: #fff; }
.page-info { color: var(--text-muted); font-size: .82rem; }

/* ═══════════════════ EMPTY STATE ═══════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  border: 2px dashed var(--border);
}

.empty-state h4 { font-size: .95rem; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.empty-state p { font-size: .845rem; color: var(--text-muted); margin-bottom: 20px; }
.empty-state-sm { padding: 30px 16px; }

/* ═══════════════════ MODAL ═══════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-sm { max-width: 380px; }

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

.modal-title { font-size: .95rem; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.modal-title i { color: var(--accent); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .9rem; padding: 4px 6px;
  border-radius: var(--radius-sm); transition: background var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text-dark); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fafbfc;
}

.quick-extend-row { margin-top: 8px; }
.quick-extend-row label { font-size: .78rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ═══════════════════ SERVICE ROW ═══════════════════ */
.service-row {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.service-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.service-row-num {
  font-size: .8rem;
  font-weight: 700;
  color: var(--navy);
  display: flex; align-items: center; gap: 6px;
}
.service-row-num i { color: var(--accent); }

.auto-renew-group .form-group { padding-top: 24px; }
@media(max-width:768px) { .auto-renew-group .form-group { padding-top: 0; } }

/* ═══════════════════ DETAIL LAYOUT ═══════════════════ */
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 9px 0; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.info-table td:last-child { border-bottom: none; }
.info-table .info-key {
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  width: 150px; white-space: nowrap; padding-right: 16px;
}
.info-table .info-val { font-size: .845rem; color: var(--text-dark); }

/* ═══════════════════ HISTORY ═══════════════════ */
.history-list { }
.history-item {
  display: flex; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.history-item:last-child { border-bottom: none; }
.history-icon {
  width: 32px; height: 32px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: .75rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.history-body { flex: 1; min-width: 0; }
.history-dates { display: flex; align-items: center; gap: 8px; font-size: .845rem; margin-bottom: 3px; }
.h-old { color: var(--text-muted); text-decoration: line-through; }
.h-arrow { color: var(--text-muted); font-size: .7rem; }
.h-new { font-weight: 700; color: var(--navy); }
.history-note { font-size: .76rem; color: var(--text-muted); }
.history-time { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════ PROVIDERS ═══════════════════ */
.two-col { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.two-col .col-main { flex: 2; min-width: 0; }
.two-col .col-side { flex: 1; min-width: 280px; }

/* ═══════════════════ TABS ═══════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: .845rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab i { font-size: .8rem; }

/* ═══════════════════ CALENDAR ═══════════════════ */
.cal-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cal-month { font-size: 1.1rem; font-weight: 700; color: var(--navy); min-width: 160px; text-align: center; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.cal-dow {
  padding: 10px 8px;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cal-cell {
  min-height: 88px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--white);
  transition: background var(--transition);
  vertical-align: top;
  position: relative;
}
.cal-cell:hover { background: #f8fafc; }
.cal-cell.empty { background: #fafbfc; }
.cal-cell.today { background: #eff6ff; }
.cal-day { font-size: .78rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--accent); }
.cal-cell:not(.empty):not(.today) .cal-day { color: var(--text-mid); }

.cal-event {
  font-size: .67rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.cal-event a { color: inherit; }
.cal-ev-red    { background: #fef2f2; color: #991b1b; }
.cal-ev-orange { background: #fff7ed; color: #9a3412; }
.cal-ev-yellow { background: #fefce8; color: #854d0e; }
.cal-ev-green  { background: #f0fdf4; color: #166534; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: .77rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ═══════════════════ IMPORT STEPS ═══════════════════ */
.import-steps { display: flex; gap: 0; margin-bottom: 24px; }
.import-step {
  flex: 1;
  padding: 12px 16px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-right: none;
  display: flex; align-items: center; gap: 8px;
  transition: all var(--transition);
}
.import-step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.import-step:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.import-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.import-step.active { background: var(--sidebar-bg, #111827); color: #fff; border-color: var(--navy); }
.import-step.active .import-step-num { background: rgba(255,255,255,.2); color: #fff; }
.import-step.done { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.import-step.done .import-step-num { background: #16a34a; color: #fff; }

/* ═══════════════════ BREADCRUMB ═══════════════════ */
.breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--accent); font-weight: 500; }
.breadcrumb i { font-size: .65rem; color: var(--text-muted); }


/* ═══════════════════ LOGIN PAGE (MODERN) ═══════════════════ */
body.page-login {
  background: #0f172a;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  position: relative;
  overflow: hidden;
}

body.page-login::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,.3) 0%, transparent 70%);
  top: -100px; left: -100px;
  pointer-events: none;
}
body.page-login::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,.2) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  pointer-events: none;
}

.login-wrap { width: 100%; max-width: 400px; position: relative; z-index: 1; }

.login-card {
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.1);
  padding: 44px 40px 36px;
  backdrop-filter: blur(10px);
}

.login-logo { text-align: center; margin-bottom: 36px; }

.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  color: #fff;
  margin: 0 auto 18px;
  box-shadow: 0 10px 30px rgba(37,99,235,.4);
}
.login-logo-icon .svg-icon { width: 28px; height: 28px; }

.login-logo h1 {
  font-size: 1.5rem; font-weight: 800; color: #0f172a; margin: 0 0 5px;
  letter-spacing: -.5px;
}
.login-logo p { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* Modern input group style */
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-group label {
  font-size: .78rem; font-weight: 600;
  color: #374151; margin-bottom: 6px; display: block;
  letter-spacing: .2px;
}
.login-card .input-icon-wrap { position: relative; }
.login-card .input-icon-wrap > .svg-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: #9ca3af; pointer-events: none; z-index: 1;
  width: 16px; height: 16px;
}
.login-card .form-control {
  padding-left: 42px;
  height: 46px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: .9rem;
  background: #f9fafb;
  transition: all .18s;
}
.login-card .form-control:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-card .input-eye-btn {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #9ca3af; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.login-card .input-eye-btn:hover { color: #374151; }

.login-card .btn-primary {
  height: 46px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  background: #111827;
  border-color: #111827;
  letter-spacing: .1px;
  margin-top: 8px;
  gap: 8px;
}
.login-card .btn-primary:hover { background: #1f2937; border-color: #1f2937; }

.login-card .alert { border-radius: 10px; font-size: .83rem; }

.login-footer-text {
  text-align: center; margin-top: 20px;
  font-size: .73rem; color: rgba(255,255,255,.35);
}


/* ═══════════════════ UTILITIES ═══════════════════ */
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }
.gap-2 { gap: 8px; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: #dc2626 !important; }
.text-success { color: #16a34a !important; }
.text-sm { font-size: .78rem !important; }
.text-xs { font-size: .7rem !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-1 { flex: 1; }
code {
  background: #f1f5f9;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .82rem;
  font-family: 'Courier New', monospace;
}

/* Row states */
.tr-danger td { background: #fef2f2 !important; }
.tr-danger td:first-child { border-left: 3px solid #dc2626; }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 1.7rem; }
  .detail-layout { grid-template-columns: 1fr; }
}


@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-close-btn { display: flex; }
  .main-content { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .content-wrap { padding: 16px; }
  .topbar { padding: 0 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  

  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }

  .two-col { flex-direction: column; }
  .two-col .col-main, .two-col .col-side { min-width: 0; width: 100%; }

  .form-row { flex-direction: column; gap: 0; }
  .auto-renew-group .form-group { padding-top: 0; }

  .filter-row { flex-direction: column; }
  .filter-search, .filter-select { min-width: 0; width: 100%; }

  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-event { font-size: .62rem; }

  .import-steps { flex-direction: column; gap: 6px; }
  .import-step { border-right: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; }

  .tabs { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
  .quick-filters { gap: 5px; }
  .qfilter { font-size: .72rem; padding: 4px 10px; }
  .modal-box { margin: 10px; }
}

/* ═══════════════════ SIDEBAR LOGO ═══════════════════ */
.sidebar-logo {
  background: transparent !important;
  box-shadow: none !important;
  padding: 2px;
}
.sidebar-logo img {
  width: 34px; height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

/* ═══════════════════ BRAND SETTINGS ═══════════════════ */
.brand-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 580px;
}
.brand-upload-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.brand-preview {
  width: 100%; min-height: 100px;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc; overflow: hidden;
}
.brand-preview img {
  max-width: 100%; max-height: 90px;
  object-fit: contain; border-radius: 6px;
}
.brand-preview.small { min-height: 64px; }
.brand-preview.small img { max-height: 56px; }
.brand-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════ BULK SELECT ═══════════════════ */
.th-check, .td-check {
  width: 40px; padding: 0 8px !important; text-align: center;
}

.bulk-checkbox {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

tr[data-id] { cursor: pointer; }
tr[data-id]:has(.row-check:checked) {
  background: #eff6ff !important;
}

.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 10px;
  gap: 12px;
  animation: bulkSlide .15s ease;
}
@keyframes bulkSlide {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.bulk-bar-left {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; color: #1e40af;
}
.bulk-count {
  background: #2563eb; color: #fff;
  border-radius: 20px; padding: 2px 9px;
  font-size: .78rem; font-weight: 700;
}
.bulk-bar-right { display: flex; gap: 8px; }
