/* ==============================================
   OPTIMIS Dashboard — Dark Theme
   Inspired by modern telecom dashboard templates
   ============================================== */

:root {
  --sidebar-bg:      #0d1829;
  --sidebar-text:    rgba(255,255,255,.65);
  --sidebar-hover:   rgba(255,255,255,.06);
  --sidebar-active:  #0891b2;
  --navbar-bg:       #0d1829;
  --navbar-h:        60px;
  --footer-h:        44px;
  --sidebar-w:       220px;
  --bg-page:         #131c2e;
  --card-bg:         #1b2540;
  --card-border:     rgba(255,255,255,.07);
  --card-shadow:     0 2px 8px rgba(0,0,0,.35);
  --primary:         #0891b2;
  --primary-dark:    #0e7490;
  --primary-light:   rgba(8,145,178,.15);
  --border-color:    rgba(255,255,255,.08);
  --text-heading:    #e2e8f0;
  --text-body:       #94a3b8;
  --text-muted:      #64748b;
}

/* =====================
   BASE
   ===================== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  padding-top: var(--navbar-h);
  padding-left: var(--sidebar-w);
  overflow: hidden;
  height: 100vh;
}

/* Layout wrapper — sandwiched between fixed navbar & footer */
body > .container-fluid {
  height: calc(100vh - var(--navbar-h) - var(--footer-h));
  overflow: hidden;
  padding: 0;
}
body > .container-fluid > .row {
  height: 100%;
  overflow: hidden;
}

/* =====================
   NAVBAR
   ===================== */
.navbar {
  background-color: var(--navbar-bg) !important;
  height: var(--navbar-h);
  padding: 0 1.25rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
  left: var(--sidebar-w);
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
}
.navbar-brand img { height: auto; max-height: 52px; width: auto; }

.navbar .nav-link {
  color: rgba(255,255,255,.7) !important;
  font-size: .875rem;
}
.navbar .nav-link:hover { color: #fff !important; }

.navbar-toggler {
  border-color: rgba(255,255,255,.4) !important;
  padding: .35rem .5rem;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar .icon-btn {
  width: 34px; height: 34px;
  border-radius: .5rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.navbar .icon-btn:hover {
  background: rgba(8,145,178,.2);
  color: #22d3ee;
  border-color: rgba(8,145,178,.3);
}

.navbar .dropdown-menu {
  background: #1b2540;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  border-radius: .625rem;
  min-width: 210px;
  padding: .5rem;
}
.navbar .dropdown-item {
  border-radius: .375rem;
  font-size: .875rem;
  padding: .5rem .75rem;
  color: var(--text-body);
}
.navbar .dropdown-item:hover {
  background: rgba(8,145,178,.12);
  color: var(--text-heading);
}
.navbar .dropdown-item.text-danger { color: #f87171 !important; }
.navbar .dropdown-item.text-danger:hover { background: rgba(239,68,68,.12); }

.navbar .dropdown-divider { border-color: var(--card-border); }

.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff; font-size: .8rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar-col {
  position: fixed;
  top: 0; left: 0;
  bottom: var(--footer-h);
  width: var(--sidebar-w);
  z-index: 1040;
  background-color: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Sidebar Header — logo, same height as navbar */
.sidebar-header {
  flex-shrink: 0;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .75rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-header img {
  max-height: 80px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* Sidebar Menu — scrollable */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding-top: .5rem;
}
.sidebar-menu::-webkit-scrollbar { display: none; }

.sidebar-section {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: #e2e8f0;
  padding: 1.25rem 1.25rem .4rem;
  display: block;
}

.sidebar-menu .nav-link {
  color: var(--sidebar-text);
  padding: .6rem 1.25rem;
  font-size: .865rem; font-weight: 500;
  display: flex; align-items: center; gap: .625rem;
  border-left: 3px solid transparent;
  border-radius: 0;
  transition: all .15s ease;
}
.sidebar-menu .nav-link i {
  font-size: 1rem; width: 1.2rem;
  flex-shrink: 0; text-align: center;
}
.sidebar-menu .nav-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,.92);
  border-left-color: rgba(255,255,255,.15);
}
.sidebar-menu .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: #67e8f9;
}
.sidebar-menu .nav-link.active i { color: #a5f3fc; }

/* Sidebar Footer — user info */
.sidebar-user {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user .user-label {
  font-size: .67rem; color: rgba(255,255,255,.28);
  text-transform: uppercase; letter-spacing: .07em;
  display: block; margin-bottom: .2rem;
}
.sidebar-user .user-name {
  color: rgba(255,255,255,.88); font-weight: 600;
  font-size: .875rem; display: block;
}
.sidebar-user .user-role {
  font-size: .72rem; color: rgba(255,255,255,.35); display: block;
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.content-header {
  flex-shrink: 0;
  padding: 1.25rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.75rem 2rem;
  background-color: #6b7a9b;
}

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .875rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
  font-size: 1.375rem; font-weight: 700;
  color: var(--text-heading); margin: 0;
}

/* =====================
   CARDS
   ===================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .75rem;
  box-shadow: var(--card-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  font-weight: 600; font-size: .9rem;
  color: var(--text-heading);
  padding: .875rem 1.25rem;
  border-radius: .75rem .75rem 0 0 !important;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  border-radius: .5rem; font-weight: 500;
  font-size: .875rem; transition: all .15s ease;
}
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: .4rem; }

/* Secondary/back/cancel button */
.btn-secondary-dark {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-body);
  border-radius: .5rem;
  font-size: .875rem; font-weight: 500;
}
.btn-secondary-dark:hover {
  background: rgba(255,255,255,.12);
  color: var(--text-heading);
  border-color: rgba(255,255,255,.2);
}

/* =====================
   FORMS
   ===================== */
.form-control, .form-select {
  background-color: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: var(--text-heading);
  border-radius: .5rem; font-size: .9rem;
}
.form-control::placeholder { color: rgba(255,255,255,.28); }
.form-control:focus, .form-select:focus {
  background-color: rgba(255,255,255,.09);
  border-color: #0891b2;
  color: var(--text-heading);
  box-shadow: 0 0 0 3px rgba(8,145,178,.18);
}
.form-select option { background: #1b2540; color: var(--text-heading); }
.form-label {
  color: rgba(255,255,255,.72);
  font-weight: 500; font-size: .875rem; margin-bottom: .375rem;
}
.input-group-text {
  background: rgba(8,145,178,.15);
  border-color: rgba(255,255,255,.12);
  color: #22d3ee;
}
.form-check-input {
  background-color: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-check-label { color: var(--text-heading); }
.form-text { color: var(--text-muted); }

.btn-outline-secondary {
  border-color: rgba(255,255,255,.15) !important;
  color: rgba(255,255,255,.5) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  background: rgba(255,255,255,.08) !important;
  color: var(--text-heading) !important;
}

/* =====================
   TABLES
   ===================== */
.table { font-size: .875rem; }
.table thead th {
  font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .07em;
  color: #e2e8f0;
  background: rgba(0,0,0,.2);
  border-top: none;
  border-bottom: 1px solid var(--card-border);
  padding: .75rem 1rem;
}
.table tbody td {
  padding: .8rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-body);
}
.table tbody tr:hover td {
  background: rgba(8,145,178,.06);
}
.table tbody tr:last-child td { border-bottom: none; }

/* =====================
   BADGES
   ===================== */
.badge {
  font-size: .7rem; font-weight: 600;
  padding: .3em .65em;
  border-radius: .35rem; letter-spacing: .02em;
}

/* =====================
   ALERTS
   ===================== */
.alert {
  border: none; border-radius: .625rem;
  font-size: .875rem; padding: .8rem 1rem;
}
.alert-danger {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border-left: 3px solid #ef4444;
}
.alert-success {
  background: rgba(34,197,94,.1);
  color: #86efac;
  border-left: 3px solid #22c55e;
}
.alert-warning {
  background: rgba(245,158,11,.1);
  color: #fcd34d;
  border-left: 3px solid #f59e0b;
}
.alert .btn-close { filter: invert(1) opacity(.5); }

/* =====================
   BREADCRUMB
   ===================== */
.breadcrumb {
  background: transparent; padding: 0;
  margin-bottom: .625rem; font-size: .8rem;
}
.breadcrumb-item a { color: #22d3ee; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { content: '›'; color: var(--text-muted); }

/* =====================
   FOOTER
   ===================== */
.app-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1020;
  height: var(--footer-h);
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 0 1.75rem;
  display: flex; align-items: center;
  font-size: .78rem; color: var(--text-muted);
}

/* =====================
   AUTH PAGES
   ===================== */
body.auth-body {
  padding-top: 0;
  background: #c2dce6;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.auth-wrap { width: 100%; max-width: 420px; padding: 1.25rem; }
.auth-card {
  background: #0f1e2e;
  border-radius: 1rem;
  border: 1px solid rgba(8,145,178,.25);
  box-shadow: 0 8px 40px rgba(15,30,46,.18), 0 0 0 1px rgba(8,145,178,.08);
  padding: 0; overflow: hidden;
}
.auth-card-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem 1.5rem .5rem;
  background: #0f1e2e;
}
.auth-card-logo img {
  width: 100%; height: auto; max-height: 190px;
  object-fit: contain; display: block;
}
.auth-card-body { padding: 1.25rem 2rem 2.25rem; }
.auth-subtitle {
  text-align: center; color: rgba(255,255,255,.5);
  font-size: .85rem; margin-bottom: 1.5rem;
}
.auth-card-body .form-label { color: rgba(255,255,255,.8); }
.auth-card-body .form-control {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.15); color: #fff;
}
.auth-card-body .form-control::placeholder { color: rgba(255,255,255,.3); }
.auth-card-body .form-control:focus {
  background: rgba(255,255,255,.11);
  border-color: #22d3ee; color: #fff;
  box-shadow: 0 0 0 3px rgba(8,145,178,.22);
}
.auth-card-body .input-group-text {
  background: rgba(8,145,178,.18);
  border-color: rgba(255,255,255,.15); color: #22d3ee;
}
.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.28); font-size: .75rem; margin: 1.25rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,.1);
}
.auth-card-body .text-muted { color: rgba(255,255,255,.45) !important; }

/* =====================
   MOBILE OFFCANVAS
   ===================== */
#mobileSidebar .offcanvas-header {
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
#mobileSidebar .offcanvas-body {
  padding: 0; background-color: var(--sidebar-bg);
}
#mobileSidebar .sidebar-col { display: block !important; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 767.98px) {
  body {
    padding-left: 0;
  }
  .navbar {
    left: 0;
  }
  .content-header,
  .content-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* =====================
   SCROLLBAR
   ===================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
