/* ============================================================
   Sleek Portal — Brand Theme
   Overrides Bootstrap 5 with Sleek Website Design brand colors
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --primary:        #FF204E;
  --primary-dark:   #d4163e;
  --primary-light:  #ff4f72;
  --primary-bg:     #fff0f3;
  --dark:           #0F172A;
  --dark-2:         #1E293B;
  --dark-3:         #334155;
  --slate:          #475569;
  --slate-light:    #64748B;
  --muted:          #94A3B8;
  --border:         #E2E8F0;
  --surface:        #F8FAFC;
  --white:          #FFFFFF;
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --info:           #3B82F6;
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius:         10px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.14);
  --transition:     all .2s ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--dark);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Bootstrap Color Overrides ───────────────────────────────────────────── */
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
  padding: .5rem 1.25rem;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,32,78,.3); }
.btn-primary:active { transform: none; }

.btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  border-radius: 8px;
  font-weight: 600;
}
.btn-outline-primary:hover { background: var(--primary) !important; color: #fff !important; }

.btn-danger  { background: var(--danger) !important; border-color: var(--danger) !important; border-radius: 8px; font-weight: 600; }
.btn-success { background: var(--success) !important; border-color: var(--success) !important; border-radius: 8px; font-weight: 600; }
.btn-secondary { background: var(--border) !important; border-color: var(--border) !important; color: var(--slate) !important; border-radius: 8px; font-weight: 600; }
.btn-light { background: var(--surface) !important; border-color: var(--border) !important; color: var(--dark-3) !important; border-radius: 8px; }

.btn { border-radius: 8px; font-weight: 500; }
.btn-sm { padding: .3rem .75rem; font-size: 13px; }
.btn-lg { padding: .75rem 1.75rem; font-size: 15px; }

/* ── Badge overrides ─────────────────────────────────────────────────────── */
.badge {
  font-weight: 600;
  letter-spacing: .3px;
  border-radius: 6px;
  padding: .3em .65em;
  font-size: 11px;
}
.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; }
.badge.bg-danger  { background: var(--danger)  !important; }
.badge.bg-info    { background: var(--info)    !important; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 15px;
}
.card-body { padding: 1.25rem; }
.card-footer { background: #fff; border-top: 1px solid var(--border); padding: .875rem 1.25rem; }

/* ── Form Controls ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--border);
  font-size: 14px;
  color: var(--dark);
  padding: .5rem .875rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,32,78,.1);
}
.form-label { font-weight: 500; font-size: 13px; color: var(--dark-3); margin-bottom: .35rem; }
.form-text  { color: var(--muted); font-size: 12px; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border: none; font-size: 14px; }
.alert-danger  { background: #FEF2F2; color: #991B1B; }
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-info    { background: #EFF6FF; color: #1E40AF; }
.alert-warning { background: #FFFBEB; color: #92400E; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { font-size: 14px; color: var(--dark); }
.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: .875rem 1rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td { padding: .875rem 1rem; vertical-align: middle; border-color: var(--border); }
.table-hover tbody tr:hover { background: var(--surface); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.sidebar-brand-logo {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.sidebar-brand-text small { font-weight: 400; font-size: 11px; color: var(--muted); display: block; }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: .75rem 1.25rem .35rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .625rem 1.25rem;
  color: #94A3B8;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  margin: 1px .5rem;
  border-radius: 8px;
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-link .badge { margin-left: auto; font-size: 10px; }

.sidebar-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: var(--muted); }

/* ── Main Layout ─────────────────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  gap: 1rem;
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.topbar-btn {
  width: 38px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}
.topbar-btn:hover { background: var(--border); color: var(--dark); }
.topbar-btn .badge-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #fff;
}

.page-content { flex: 1; padding: 1.75rem 1.5rem; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--dark); margin: 0 0 .25rem; }
.page-header p  { color: var(--muted); margin: 0; font-size: 14px; }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: #ECFDF5; color: var(--success); }
.stat-icon.warning { background: #FFFBEB; color: var(--warning); }
.stat-icon.info    { background: #EFF6FF; color: var(--info); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: .25rem; }

/* ── Status Timeline ─────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute; left: .6rem; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -1.65rem; top: .1rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
}
.timeline-dot.active { background: var(--primary); border-color: var(--primary); }
.timeline-dot.completed { background: var(--success); border-color: var(--success); }
.timeline-title { font-weight: 600; font-size: 14px; color: var(--dark); }
.timeline-meta  { font-size: 12px; color: var(--muted); margin-top: .2rem; }
.timeline-note  { font-size: 13px; color: var(--slate); margin-top: .35rem; background: var(--surface); border-radius: 6px; padding: .5rem .75rem; border-left: 3px solid var(--border); }

/* ── Chat ────────────────────────────────────────────────────────────────── */
.chat-window {
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.chat-msg { display: flex; gap: .625rem; max-width: 80%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.chat-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .5rem .875rem;
  font-size: 14px;
  line-height: 1.5;
}
.chat-msg.mine .chat-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-meta { font-size: 11px; color: var(--muted); margin-top: .25rem; }
.chat-msg.mine .chat-meta { text-align: right; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.nav-tabs { border-bottom: 2px solid var(--border); }
.nav-tabs .nav-link {
  border: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  padding: .625rem 1rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.nav-tabs .nav-link:hover { color: var(--dark); border-bottom-color: var(--border); }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { font-size: 13px; }
.breadcrumb-item a { color: var(--muted); }
.breadcrumb-item.active { color: var(--dark); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

/* ── Notification Dropdown ───────────────────────────────────────────────── */
.notif-dropdown {
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.notif-item {
  display: flex; gap: .75rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: var(--primary-bg); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-title { font-size: 13px; font-weight: 600; color: var(--dark); }
.notif-body  { font-size: 12px; color: var(--muted); }
.notif-time  { font-size: 11px; color: var(--muted); margin-top: .25rem; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-content { border: none; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--border); padding: 1.25rem 1.5rem; }
.modal-footer  { border-top: 1px solid var(--border); padding: 1rem 1.5rem; }
.modal-title   { font-size: 16px; font-weight: 700; }

/* ── Spinner / Loading ───────────────────────────────────────────────────── */
.spinner-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center;
}
.loading-btn { position: relative; pointer-events: none; opacity: .8; }
.loading-btn::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container { z-index: 9000; }
.toast {
  border-radius: 10px;
  border: none;
  box-shadow: var(--shadow);
  min-width: 280px;
}

/* ── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px;
  padding: 2.5rem;
}
.auth-logo {
  text-align: center; margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff;
  margin: 0 auto 12px;
}
.auth-logo-text { font-size: 20px; font-weight: 800; color: var(--dark); }
.auth-logo-text span { color: var(--primary); }
.auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: .35rem; }
.auth-card .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 1.5rem; }
.auth-divider { text-align: center; color: var(--muted); font-size: 13px; margin: 1rem 0; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 14px; color: var(--muted); }

/* ── Service Cards (Smart Form) ──────────────────────────────────────────── */
.service-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: #fff;
  height: 100%;
}
.service-card:hover { border-color: var(--primary); background: var(--primary-bg); transform: translateY(-2px); box-shadow: var(--shadow); }
.service-card.selected { border-color: var(--primary); background: var(--primary-bg); }
.service-card i { font-size: 28px; color: var(--primary); display: block; margin-bottom: .75rem; }
.service-card h6 { font-size: 13px; font-weight: 700; color: var(--dark); margin: 0 0 .35rem; }
.service-card p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.4; }

/* ── Step Indicators ─────────────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}
.step-item { display: flex; align-items: center; flex: 1; }
.step-item:last-child { flex: 0; }
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  background: #fff;
  flex-shrink: 0;
  transition: var(--transition);
}
.step-circle.active { border-color: var(--primary); color: var(--primary); }
.step-circle.done   { border-color: var(--success); background: var(--success); color: #fff; }
.step-label { font-size: 12px; color: var(--muted); margin-top: .35rem; white-space: nowrap; }
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-item.done .step-label   { color: var(--success); }
.step-connector { flex: 1; height: 2px; background: var(--border); margin: 0 .5rem; margin-bottom: 1rem; }
.step-connector.done { background: var(--success); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state i { font-size: 48px; color: var(--border); display: block; margin-bottom: 1rem; }
.empty-state h5 { color: var(--dark-3); font-weight: 600; }
.empty-state p  { color: var(--muted); font-size: 14px; }

/* ── File Items ──────────────────────────────────────────────────────────── */
.file-item {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: var(--transition);
}
.file-item:hover { border-color: var(--primary); background: var(--primary-bg); }
.file-icon { font-size: 28px; flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 14px; color: var(--dark); }
.file-meta { font-size: 12px; color: var(--muted); }
.file-actions { margin-left: auto; display: flex; gap: .5rem; }

/* ── Search/Filter Bar ───────────────────────────────────────────────────── */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }

/* ── Priority Badge ──────────────────────────────────────────────────────── */
.priority-urgent { color: var(--danger);  font-weight: 700; }
.priority-high   { color: var(--warning); font-weight: 700; }
.priority-normal { color: var(--info); }
.priority-low    { color: var(--muted); }

/* ── Invoice ─────────────────────────────────────────────────────────────── */
.invoice-header { background: var(--dark); color: #fff; padding: 2rem; border-radius: var(--radius) var(--radius) 0 0; }
.invoice-total-box { background: var(--primary-bg); border-radius: var(--radius); padding: 1rem 1.25rem; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrap { margin-left: 0 !important; }
}
