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

:root {
  /* Premium Dark Blue/Slate Sidebar */
  --bg-sidebar: #0b1329;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  
  /* Background & Surface */
  --bg-main: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-focus: #4f46e5;
  
  /* Brand Accents - Indigo, Cyan, Emerald, Rose */
  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-secondary: #0ea5e9;
  --accent-success: #10b981;
  --accent-danger: #f43f5e;
  --accent-warning: #f59e0b;
  --accent-info: #06b6d4;
  
  /* Text colors */
  --text-main: #0f172a;
  --text-soft: #64748b;
  --text-light: #94a3b8;
  
  /* Sizing & Spacing */
  --base-font-size: 13.5px;
  --base-spacing: 1rem;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Sidebar Navigation */
.side-nav {
  background: var(--bg-sidebar);
  color: var(--sidebar-text);
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.brand-block {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  color: var(--accent-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Sidebar Accordion Overrides */
.side-accordion {
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
  flex-grow: 1;
}

.side-accordion .accordion-item {
  background: transparent;
  border: none;
  margin-bottom: 6px;
}

.side-accordion .accordion-button {
  background: transparent;
  color: var(--sidebar-text);
  border: none;
  border-radius: 8px !important;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0.75rem 1rem;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

.side-accordion .accordion-button::after {
  filter: invert(1) brightness(0.7);
  background-size: 11px;
}

.side-accordion .accordion-button:not(.collapsed) {
  background: var(--bg-sidebar-hover);
  color: var(--sidebar-text-active);
}

.side-accordion .accordion-button:not(.collapsed)::after {
  filter: invert(1) brightness(1);
}

.side-accordion .accordion-button:hover {
  background: var(--bg-sidebar-hover);
  color: var(--sidebar-text-active);
}

.side-accordion .accordion-body {
  padding: 0.4rem 0.5rem 0.5rem 1.5rem;
}

.menu-link {
  display: block;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 13px;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
  margin-bottom: 2px;
}

.menu-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--sidebar-text-active);
  transform: translateX(4px);
}

.menu-link.active {
  background: rgba(79, 70, 229, 0.15) !important;
  color: #a5b4fc !important;
  font-weight: 700 !important;
  border-left: 3px solid var(--accent-secondary);
  padding-left: calc(0.85rem - 3px);
}

/* Main Content Area */
.main-pane {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header Strip */
.top-strip {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.page-title {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.operator-box-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.operator-box {
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.15);
  color: var(--accent-primary);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

/* Content Container */
.content-pane {
  padding: 1.75rem 2rem;
  flex-grow: 1;
  overflow-y: auto;
}

/* Premium Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.01) !important;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.65rem;
}

/* Forms & Controls */
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control, .form-select {
  font-size: 13.5px !important;
  padding: 0.45rem 0.85rem !important;
  border-color: #cbd5e1;
  border-radius: 8px !important;
  min-height: 38px;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12) !important;
}

/* Buttons */
.btn {
  font-size: 13.5px !important;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 8px !important;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #6366f1 100%);
  border: none !important;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
  color: #fff !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
}

.btn-outline-danger {
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

.btn-outline-danger:hover {
  background-color: var(--accent-danger);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.2);
}

.btn-sm {
  font-size: 12px !important;
  padding: 0.3rem 0.75rem;
  min-height: 28px;
  border-radius: 6px !important;
}

/* Badges with Glassy aesthetics */
.badge {
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.35em 0.7em;
  border-radius: 6px;
  text-transform: uppercase;
  font-size: 10px !important;
}

.text-bg-success {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-bg-danger {
  background-color: #ffe4e6 !important;
  color: #9f1239 !important;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.text-bg-info {
  background-color: #ecfeff !important;
  color: #155e75 !important;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.text-bg-warning {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Tables */
.table {
  font-size: 13px;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.75rem 0.85rem;
  border-bottom-color: #f1f5f9;
}

.table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  background-color: #f8fafc;
  color: var(--text-soft);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Login Page Specific */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, #1e1b4b 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-card .brand-title {
  color: var(--text-main);
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.login-card .brand-subtitle {
  text-align: center;
  display: block;
  margin-bottom: 2rem;
}

/* Hamburger Toggle Button */
.hamburger-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.3rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  color: var(--text-main);
  line-height: 1;
  display: none;
  transition: all 0.2s ease;
}

.hamburger-btn:hover {
  background-color: #f1f5f9;
}

/* Sidebar overlay for mobile */
.side-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
}

.side-nav-overlay.active {
  display: block;
}

/* ═══════════════════════════════════════════
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ═══════════════════════════════════════════ */

@media (max-width: 991.98px) {
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .side-nav {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    height: 100vh;
    z-index: 1100;
    overflow-y: auto;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
  }

  .side-nav.open {
    transform: translateX(0);
  }

  .brand-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .brand-block .hamburger-btn {
    color: #fff;
    border-color: rgba(255,255,255,0.15);
  }
  
  .top-strip {
    height: auto;
    padding: 0.85rem 1.25rem;
    gap: 0.75rem;
  }

  .content-pane {
    padding: 1rem 1.25rem;
  }

  .operator-box-wrap {
    gap: 0.5rem;
  }

  .operator-box {
    padding: 0.3rem 0.6rem;
    font-size: 11px;
  }
}

/* ═══════════════════════════════════════════
   MOBILE FIRST — Under 768px
   Complete UX overhaul for small screens
   ═══════════════════════════════════════════ */
@media (max-width: 767.98px) {

  /* ── Typography Scale ── */
  body {
    font-size: 14px;
    line-height: 1.6;
  }

  .page-title {
    font-size: 1.1rem;
  }

  .card-title {
    font-size: 1rem;
  }

  /* ── Top Strip ── */
  .top-strip {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .operator-box-wrap {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
  }

  /* ── Content Pane ── */
  .content-pane {
    padding: 0.85rem 0.85rem 5rem 0.85rem; /* bottom padding for mobile browser chrome */
  }

  /* ── Cards ── */
  .card {
    border-radius: 10px !important;
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  /* ── Forms: Bigger touch targets ── */
  .form-control,
  .form-select {
    font-size: 15px !important;      /* prevents iOS auto-zoom on focus */
    min-height: 44px !important;     /* Apple HIG touch target */
    padding: 0.6rem 0.9rem !important;
    border-radius: 10px !important;
  }

  .form-label {
    font-size: 12px;
    margin-bottom: 0.4rem;
  }

  .form-text {
    font-size: 11.5px;
  }

  /* ── Buttons: Full-width & tall on mobile ── */
  .btn {
    min-height: 44px !important;
    font-size: 14px !important;
    padding: 0.6rem 1.2rem;
    border-radius: 10px !important;
  }

  .btn-sm {
    min-height: 36px !important;
    font-size: 12.5px !important;
    padding: 0.4rem 0.9rem;
  }

  /* d-grid buttons go full width automatically */
  .col-12 .btn,
  .d-grid .btn {
    width: 100%;
  }

  /* ── Row gutters tighter ── */
  .g-2 > * {
    padding: 0.25rem;
  }

  /* ── Badges ── */
  .badge {
    font-size: 11px !important;
    padding: 0.4em 0.8em;
  }

  /* ── Tables: Card transformation ── */
  table.table {
    border: 0;
  }

  table.table thead {
    display: none !important;
  }

  table.table tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  }

  table.table tbody tr:hover {
    background-color: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  }

  table.table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    font-size: 14px;
  }

  table.table tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  table.table tbody td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    color: var(--text-soft);
    letter-spacing: 0.6px;
    text-align: left;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  table.table tbody tr td:only-child {
    display: block;
    text-align: center !important;
    border: none;
    padding: 1.5rem;
    color: var(--text-soft);
  }

  table.table tbody tr td:only-child::before {
    display: none !important;
  }

  table.table tbody td > * {
    text-align: right;
    margin-left: auto;
  }

  /* ── Pagination ── */
  .btn-group {
    width: 100%;
  }

  .btn-group .btn {
    flex-grow: 1;
  }
}

