/* ═══════════════════════════════════════════════════════
   INSUSER — Dashboard Styles
   ═══════════════════════════════════════════════════════ */

/* ── Login Page ────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -300px;
  right: -300px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -300px;
  left: -300px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(26, 82, 118, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.login-card .login-logo {
  display: block;
  margin: 0 auto 2rem;
  height: 60px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: var(--navy);
}

.login-card .login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  text-align: center;
}

.login-error.show {
  display: block;
}

.login-card .form-group input {
  padding: 0.85rem 1rem;
}

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 0.9rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.login-back {
  text-align: center;
  margin-top: 1.5rem;
}

.login-back a {
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 500;
}

.login-back a:hover {
  color: var(--gold);
}

/* ── Dashboard Layout ──────────────────────────────── */
.dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--gray-100);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-header img {
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  padding: 3px 6px;
}

.sidebar-header span {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav-group {
  margin-bottom: 0.5rem;
}

.sidebar-nav-group-title {
  padding: 0.5rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  color: var(--white);
  background: rgba(26, 82, 118, 0.4);
  border-left: 3px solid var(--gold);
}

.sidebar-link .link-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Dropdown in sidebar */
.sidebar-dropdown {
  position: relative;
}

.sidebar-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sidebar-dropdown-toggle .chevron {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  color: rgba(255, 255, 255, 0.3);
}

.sidebar-dropdown.open .chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  padding-left: 1rem;
}

.sidebar-dropdown.open .sidebar-submenu {
  display: block;
}

.sidebar-submenu .sidebar-link {
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
}

.sidebar-submenu .sidebar-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.sidebar-submenu .sidebar-link:hover::before,
.sidebar-submenu .sidebar-link.active::before {
  background: var(--gold);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  justify-content: center;
}

.btn-logout:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.4);
  color: #e74c3c;
}

/* ── Main Content ──────────────────────────────────── */
.dash-main {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  min-height: 100vh;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dash-topbar h1 {
  font-size: 1.75rem;
  color: var(--navy);
}

.dash-topbar .dash-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 101;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
}

/* ── Dashboard Cards ───────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}

.dash-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dash-stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.dash-stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.dash-stat-card .stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Dashboard Tables ──────────────────────────────── */
.dash-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.dash-card-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}

.dash-card-body {
  padding: 1.5rem;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.dash-table td {
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--text-primary);
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: var(--gray-100);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-neutral {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* ── Dashboard Grid Layout ─────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ── Calendar / Timeline items ─────────────────────── */
.dash-timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
  align-items: flex-start;
}

.dash-timeline-item:last-child {
  border-bottom: none;
}

.dash-timeline-date {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  text-align: center;
  min-width: 50px;
  flex-shrink: 0;
}

.dash-timeline-date .day {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.dash-timeline-date .month {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.dash-timeline-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.dash-timeline-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Document list ─────────────────────────────────── */
.doc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.doc-info {
  flex: 1;
}

.doc-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.doc-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.doc-action {
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.doc-action:hover {
  color: var(--gold);
}

/* ── Responsive Dashboard ──────────────────────────── */
@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .dash-main {
    margin-left: 0;
    padding: 1.5rem 1rem;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .login-card {
    margin: 1rem;
    padding: 2rem;
  }
}

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

  .dash-table {
    font-size: 0.8rem;
  }

  .dash-table th,
  .dash-table td {
    padding: 0.6rem 0.5rem;
  }
}
