/* ============================================================
   Ticket Raise — Design System v3 — Light Professional Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Force light mode — prevent browser dark-mode overrides */
  color-scheme: light only;

  /* Light Professional Palette */
  --color-bg:               #FFFFFF;
  --color-surface:          #F8FAFC;
  --color-surface-hover:    #F1F5F9;
  --color-accent:           #0891B2;   /* Teal primary */
  --color-accent-2:         #0369A1;   /* Cyan secondary */
  --color-accent-rgb:       8, 145, 178;
  --color-text-primary:     #0F172A;
  --color-text-secondary:   #334155;
  --color-text-muted:       #64748B;
  --color-border:           #E2E8F0;
  --color-success:          #059669;
  --color-warning:          #D97706;
  --color-danger:           #DC2626;
  --color-danger-dark:      #991B1B;
  --color-purple:           #7C3AED;

/* ============================================================
   Ticket Raise — Design System v3 — Light Professional Theme
   ============================================================ */
 
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
 
:root {
  /* Force light mode — prevent browser dark-mode overrides */
  color-scheme: light only;
 
  /* Light Professional Palette */
  --color-bg:               #FFFFFF;
  --color-surface:          #F8FAFC;
  --color-surface-hover:    #F1F5F9;
  --color-accent:           #0891B2;   /* Teal primary */
  --color-accent-2:         #0369A1;   /* Cyan secondary */
  --color-accent-rgb:       8, 145, 178;
  --color-text-primary:     #0F172A;
  --color-text-secondary:   #334155;
  --color-text-muted:       #64748B;
  --color-border:           #E2E8F0;
  --color-success:          #059669;
  --color-warning:          #D97706;
  --color-danger:           #DC2626;
  --color-danger-dark:      #991B1B;
  --color-purple:           #7C3AED;
 
  /* Glow effects */
  --glow-teal:  0 0 20px rgba(8, 145, 178, 0.15);
  --glow-cyan:  0 0 20px rgba(3, 105, 161, 0.15);
 
  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 12px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg:  0 16px 40px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.1);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.2);
 
  /* Radius */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
 
  /* Layout */
  --sidebar-width:  250px;
  --topbar-height:  64px;
 
  /* Short-name aliases (used by dashboard / inline styles) */
  --color-text:             var(--color-text-primary);
  --color-muted:            var(--color-text-muted);
  --color-bg-secondary:     #F9FAFB;
 
  /* Backward-compat aliases */
  --color-background:       var(--color-bg);
  --color-primary:          var(--color-accent);
  --color-primary-dark:     #065f73;
  --color-primary-light:    #06B6D4;
  --color-secondary:        var(--color-accent-2);
  --color-secondary-dark:   #0c4a6e;
  --color-secondary-light:  #0EA5E9;
  --color-tertiary:         var(--color-success);
  --color-tertiary-dark:    #047857;
  --color-tertiary-light:   #10B981;
  --color-white:            #FFFFFF;
  --color-gray-50:          #F9FAFB;
  --color-gray-100:         #F3F4F6;
  --color-gray-200:         var(--color-border);
  --color-gray-300:         #D1D5DB;
  --color-gray-400:         #9CA3AF;
  --color-gray-500:         #6B7280;
  --color-gray-600:         #4B5563;
  --color-gray-700:         #334155;
  --color-gray-800:         #1F2937;
  --color-gray-900:         #111827;
}
 
/* Force light — block @media(prefers-color-scheme:dark) from ever applying */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
    --color-bg:               #FFFFFF;
    --color-surface:          #F8FAFC;
    --color-surface-hover:    #F1F5F9;
    --color-text-primary:     #0F172A;
    --color-text-secondary:   #334155;
    --color-text-muted:       #64748B;
    --color-border:           #E2E8F0;
  }
}
 
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #FFFFFF;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
}
 
/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
 
/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }
 
/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 55%, #FFFFFF 100%);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
  border-right: 1px solid var(--color-border);
}
 
.sidebar-logo {
  padding: 1.2rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
 
.sidebar-logo-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  flex-shrink: 0;
}
 
.sidebar-logo-text {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
 
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
 
.sidebar-nav .nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.55;
  padding: 0 0.6rem;
  margin: 0.6rem 0 0.3rem;
}
 
.sidebar-nav .nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.6rem 0.4rem;
  opacity: 0.7;
}
 
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.855rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  position: relative;
}
 
.sidebar-nav a .nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
}
 
.sidebar-nav a .nav-icon path,
.sidebar-nav a .nav-icon rect,
.sidebar-nav a .nav-icon circle {
  fill: currentColor;
  stroke: currentColor;
}
 
.sidebar-nav a:hover {
  background: rgba(8, 145, 178, 0.09);
  color: var(--color-accent);
  transform: translateX(2px);
}
 
.sidebar-nav a:hover .nav-icon { opacity: 1; }
 
.sidebar-nav a.active {
  background: rgba(8, 145, 178, 0.13);
  color: var(--color-accent);
  font-weight: 600;
}
 
.sidebar-nav a.active .nav-icon { opacity: 1; }
 
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--color-accent);
  border-radius: 0 3px 3px 0;
}
 
/* App Switcher */
.app-switcher {
  padding: 0.65rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
 
.app-switcher-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.5;
  margin-bottom: 0.45rem;
  padding: 0 0.2rem;
}
 
.app-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
 
.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
 
.app-switcher-item:hover {
  background: rgba(8, 145, 178, 0.07);
  color: var(--color-accent);
}
 
.app-switcher-item.active {
  background: rgba(8, 145, 178, 0.11);
  color: var(--color-accent);
  font-weight: 600;
}
 
.app-switcher-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
 
.app-switcher-item.active .app-switcher-icon {
  background: rgba(8, 145, 178, 0.18);
}
 
.app-switcher-item:hover .app-switcher-icon {
  background: rgba(8, 145, 178, 0.15);
}
 
.app-switcher-icon svg {
  width: 15px;
  height: 15px;
  color: currentColor;
}
 
.app-switcher-name {
  flex: 1;
}
 
.app-switcher-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-accent, #0891b2);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
  text-transform: uppercase;
}
 
.sidebar-raise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0.85rem 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--color-accent, #0891b2), #0e7490);
  color: #fff;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(8,145,178,0.25);
  transition: box-shadow 0.15s ease, transform 0.1s ease, background 0.15s;
  letter-spacing: 0.01em;
}
.sidebar-raise-btn:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  box-shadow: 0 4px 16px rgba(8,145,178,0.35);
  transform: translateY(-1px);
}
 
.sidebar-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
 
.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(8,145,178,0.2);
}
 
.sidebar-footer-info { min-width: 0; flex: 1; }
 
.sidebar-footer-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.sidebar-footer-role {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
 
/* ═══════════════════════════════════════
   MAIN CONTENT & TOPBAR
═══════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--color-bg);
}
 
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-xs);
}
 
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
 
.topbar-logo { width: 26px; height: 26px; object-fit: contain; }
 
.topbar-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
 
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
 
.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem 0.28rem 0.35rem;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  max-width: 200px;
}
 
.topbar-user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.topbar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #FFFFFF;
  text-transform: uppercase;
  flex-shrink: 0;
}
 
.page-content {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}
 
/* ═══════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
 
.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}
 
/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}
 
.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
 
/* ═══════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════ */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.2rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}
 
.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: rgba(8, 145, 178, 0.3);
}
 
.stat-card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
}
 
.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: rgba(8, 145, 178, 0.12);
}
 
.stat-card-body { flex: 1; min-width: 0; }
 
.stat-card .stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}
 
.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}
 
/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
  letter-spacing: 0.01em;
}
 
.btn:active { transform: translateY(1px); }
 
.btn-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(8,145,178,0.35);
}
.btn-primary:hover {
  background: #0780A0;
  box-shadow: 0 4px 12px rgba(8,145,178,0.3);
}
 
.btn-secondary {
  background: var(--color-accent-2);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(3,105,161,0.35);
}
.btn-secondary:hover {
  background: #024E8C;
  box-shadow: 0 4px 12px rgba(3,105,161,0.3);
}
 
.btn-danger {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.35);
}
.btn-danger:hover { background: var(--color-danger-dark); }
 
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: rgba(8, 145, 178, 0.08);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
 
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #059669; }
 
.btn-sm  { padding: 0.28rem 0.65rem; font-size: 0.765rem; }
.btn-lg  { padding: 0.62rem 1.35rem; font-size: 0.9rem; }
.w-full  { width: 100%; }
 
/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
 
.form-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.01em;
}
 
.form-control {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
 
.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}
 
.form-control:disabled {
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: not-allowed;
  border-color: var(--color-border);
}
 
.form-control::placeholder { color: var(--color-text-muted); }
 
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}
 
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }
 
.form-error {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: 0.3rem;
}
 
/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
 
table { width: 100%; border-collapse: collapse; font-size: 0.865rem; }
 
thead tr { background: var(--color-bg); }
 
th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1.5px solid var(--color-border);
  white-space: nowrap;
}
 
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}
 
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: rgba(8, 145, 178, 0.04); }
tbody tr:last-child td { border-bottom: none; }
 
/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
 
/* Status */
.badge-new        { background: rgba(100,116,139,0.2); color: var(--color-text-muted); }
.badge-open       { background: rgba(6,182,212,0.15); color: var(--color-accent-2); }
.badge-in-progress{ background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-resolved   { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-closed     { background: rgba(100,116,139,0.15); color: var(--color-text-muted); }
.badge-pending    { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-approved   { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-rejected   { background: rgba(239,68,68,0.15); color: var(--color-danger); }
.badge-escalated  { background: rgba(139,92,246,0.15); color: var(--color-purple); }
.badge-info       { background: rgba(6,182,212,0.15); color: var(--color-accent-2); }
 
/* Priority */
.badge-low      { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-medium   { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-high     { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-critical { background: rgba(239,68,68,0.2); color: var(--color-danger); }
 
/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-left-width: 3px;
  line-height: 1.5;
}
 
.alert-success {
  background: rgba(5, 150, 105, 0.08);
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.2);
  border-left-color: var(--color-success);
}
 
.alert-error {
  background: rgba(220, 38, 38, 0.08);
  color: #991B1B;
  border-color: rgba(220, 38, 38, 0.2);
  border-left-color: var(--color-danger);
}
 
.alert-info {
  background: rgba(8, 145, 178, 0.1);
  color: var(--color-accent);
  border-color: rgba(8, 145, 178, 0.25);
  border-left-color: var(--color-accent);
}
 
.alert-warning {
  background: rgba(217, 119, 6, 0.08);
  color: #92400E;
  border-color: rgba(217, 119, 6, 0.2);
  border-left-color: var(--color-warning);
}
 
/* ═══════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
 
.auth-brand {
  background: linear-gradient(155deg, #F8FAFC 0%, #F1F5F9 60%, #E8ECF1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
}
 
.auth-brand::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(8, 145, 178, 0.04);
  pointer-events: none;
}
 
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -25%; left: -15%;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(3, 105, 161, 0.04);
  pointer-events: none;
}
 
.auth-brand-logo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1), var(--glow-teal);
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}
 
.auth-brand-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
  text-align: center;
  position: relative;
  z-index: 1;
}
 
.auth-brand-tagline {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.7;
  max-width: 280px;
  position: relative;
  z-index: 1;
}
 
.auth-brand-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}
 
.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
 
.auth-brand-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}
 
.auth-form-panel {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
 
.auth-form-box {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
 
.auth-form-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
 
.auth-form-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
  text-align: center;
  font-weight: 500;
}
 
/* Logo for single-column login */
.auth-form-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: none;
  border: none;
  background: transparent;
  display: inline-block;
}
 
/* Override max-width for wider single-col form */
.auth-form-box {
  padding: 2.5rem;
  max-width: 520px;
}
 
/* Legacy compat */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 1rem;
}
 
.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
 
.auth-logo { display: block; margin: 0 auto 1.25rem; width: 90px; height: auto; }
.auth-logo--large { width: 100px; }
.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}
 
/* ── Microsoft button ── */
.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-microsoft:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xs);
}
 
/* ── Divider with text ── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1rem 0; }
 
.divider-text {
  position: relative;
  text-align: center;
  margin: 1.1rem 0;
}
.divider-text::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  border-top: 1px solid var(--color-border);
}
.divider-text span {
  background: var(--color-surface);
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  position: relative;
}
 
/* ═══════════════════════════════════════
   SECTION TITLE (chart cards)
═══════════════════════════════════════ */
.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
 
/* ═══════════════════════════════════════
   BAR CHARTS (CSS only)
═══════════════════════════════════════ */
.bar-row { margin-bottom: 0.65rem; }
 
.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
 
.bar-track {
  background: rgba(203, 213, 225, 0.4);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
 
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
  min-width: 4px;
  background: linear-gradient(90deg, var(--color-accent), #06B6D4);
}
 
/* ═══════════════════════════════════════
   APPROVAL CHAIN
═══════════════════════════════════════ */
.approval-step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.approval-step:last-child { border-bottom: none; }
 
.approval-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
 
.approval-step-info { flex: 1; min-width: 0; }
.approval-step-level { font-size: 0.82rem; font-weight: 600; color: var(--color-text-primary); }
.approval-step-role  { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 1px; }
 
/* ═══════════════════════════════════════
   COMMENT THREAD
═══════════════════════════════════════ */
.comment-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-item:last-child { border-bottom: none; }
 
.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
 
.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.comment-time { font-size: 0.72rem; color: var(--color-text-muted); }
.comment-body { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.55; }
 
/* ═══════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════ */
.admin-panel-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-xs);
}
.admin-panel-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.4);
}
.admin-panel-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  background: rgba(8, 145, 178, 0.1);
}
 
/* ═══════════════════════════════════════
   APPROVAL BANNER
═══════════════════════════════════════ */
.approval-banner {
  background: rgba(8, 145, 178, 0.07);
  border: 1px solid rgba(8, 145, 178, 0.25);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
 
/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}
.empty-state-text { font-size: 0.83rem; color: var(--color-text-muted); }
 
/* ═══════════════════════════════════════
   GRID HELPERS
═══════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
 
/* ═══════════════════════════════════════
   UTILITIES
═══════════════════════════════════════ */
.text-muted    { color: var(--color-text-muted); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-primary  { color: var(--color-accent); }
.text-secondary{ color: var(--color-accent-2); }
.text-danger   { color: var(--color-danger); }
.text-center   { text-align: center; }
 
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
 
/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
 
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-content { padding: 1.25rem; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
 
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
}
 
/* ============================================================
   Kanban Board
   ============================================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  min-height: 400px;
}
 
.kanban-column {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}
 
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 10px 10px 0 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
 
.kanban-column-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
 
.kanban-column-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  min-width: 1.5rem;
  text-align: center;
}
 
.kanban-column-body {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
 
.kanban-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}
 
.kanban-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--glow-teal);
}
 
.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
 
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
 
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
}
 
.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 80px;
  opacity: 0.5;
}
 
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
 
@media (max-width: 560px) {
  .kanban-board { grid-template-columns: 1fr; }
}
 
/* ═══════════════════════════════════════
   TASK PROGRESS SECTION
═══════════════════════════════════════ */
.task-progress-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
}
 
.task-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
 
.task-progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
 
.task-progress-badge {
  display: inline-block;
  background: rgba(8, 145, 178, 0.12);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}
 
.task-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
 
.task-input-group .form-control {
  flex: 1;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
}
 
.task-input-group .btn {
  flex-shrink: 0;
}
 
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
 
.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
 
.task-item:hover {
  background: var(--color-surface-hover);
  border-color: rgba(8, 145, 178, 0.3);
}
 
.task-item.task-done {
  opacity: 0.6;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}
 
.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}
 
.task-content {
  flex: 1;
  min-width: 0;
}
 
.task-text {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}
 
.task-item.task-done .task-text {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
 
.task-priority {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}
 
.task-priority.high {
  background: rgba(220, 38, 38, 0.15);
  color: #991B1B;
}
 
.task-priority.medium {
  background: rgba(217, 119, 6, 0.15);
  color: #92400e;
}
 
.task-priority.low {
  background: rgba(107, 114, 128, 0.15);
  color: #374151;
}
 
.task-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-top: 0.25rem;
}
 
.task-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
 
.task-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
}
 
.task-close-btn:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
}
 
.task-empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
 
.task-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
  font-size: 0.8rem;
}
 
.task-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
 
.task-stat-value {
  font-weight: 600;
  color: var(--color-text-primary);
}
 
.task-stat-label {
  color: var(--color-text-muted);
}
 
/* ═══════════════════════════════════════
   OLLAMA BOT WIDGET
═══════════════════════════════════════ */
.bot-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  font-family: inherit;
}
 
.bot-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.35);
  transition: all 0.3s ease;
}
 
.bot-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
}
 
.bot-toggle-btn.open {
  transform: rotate(45deg);
}
 
.bot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #EF4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 600;
}
 
.bot-container {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 500px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}
 
.bot-container.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
 
.bot-header {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: white;
  padding: 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}
 
.bot-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}
 
.bot-header-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
 
.bot-header-close:hover {
  background: rgba(255, 255, 255, 0.35);
}
 
.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
 
.bot-message {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}
 
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
 
.bot-message.user {
  justify-content: flex-end;
}
 
.bot-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: rgba(8, 145, 178, 0.12);
  color: var(--color-accent);
}
 
.bot-message.user .bot-message-avatar {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-text-muted);
  order: 2;
}
 
.bot-message-bubble {
  max-width: 280px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
 
.bot-message.user .bot-message-bubble {
  background: var(--color-accent);
  color: white;
  border: none;
}
 
.bot-message.loading .bot-message-bubble {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
 
.bot-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--color-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}
 
.bot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
 
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-8px); }
}
 
.bot-input-group {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
 
.bot-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
 
.bot-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}
 
.bot-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}
 
.bot-send-btn:hover:not(:disabled) {
  background: #0780A0;
}
 
.bot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
 
.bot-status {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.5rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: rgba(107, 114, 128, 0.05);
}
 
.bot-status.error {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.05);
}
 
.bot-status.connected {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.05);
}
 
@media (max-width: 480px) {
  .bot-widget {
    bottom: 1rem;
    right: 1rem;
  }
 
  .bot-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    bottom: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
 
  .bot-toggle-btn {
    width: 48px;
    height: 48px;
  }
}

  /* Glow effects */
  --glow-teal:  0 0 20px rgba(8, 145, 178, 0.15);
  --glow-cyan:  0 0 20px rgba(3, 105, 161, 0.15);

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 12px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg:  0 16px 40px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.1);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.2);

  /* Radius */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Layout */
  --sidebar-width:  250px;
  --topbar-height:  64px;

  /* Short-name aliases (used by dashboard / inline styles) */
  --color-text:             var(--color-text-primary);
  --color-muted:            var(--color-text-muted);
  --color-bg-secondary:     #F9FAFB;

  /* Backward-compat aliases */
  --color-background:       var(--color-bg);
  --color-primary:          var(--color-accent);
  --color-primary-dark:     #065f73;
  --color-primary-light:    #06B6D4;
  --color-secondary:        var(--color-accent-2);
  --color-secondary-dark:   #0c4a6e;
  --color-secondary-light:  #0EA5E9;
  --color-tertiary:         var(--color-success);
  --color-tertiary-dark:    #047857;
  --color-tertiary-light:   #10B981;
  --color-white:            #FFFFFF;
  --color-gray-50:          #F9FAFB;
  --color-gray-100:         #F3F4F6;
  --color-gray-200:         var(--color-border);
  --color-gray-300:         #D1D5DB;
  --color-gray-400:         #9CA3AF;
  --color-gray-500:         #6B7280;
  --color-gray-600:         #4B5563;
  --color-gray-700:         #334155;
  --color-gray-800:         #1F2937;
  --color-gray-900:         #111827;
}

/* Force light — block @media(prefers-color-scheme:dark) from ever applying */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
    --color-bg:               #FFFFFF;
    --color-surface:          #F8FAFC;
    --color-surface-hover:    #F1F5F9;
    --color-text-primary:     #0F172A;
    --color-text-secondary:   #334155;
    --color-text-muted:       #64748B;
    --color-border:           #E2E8F0;
  }
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #FFFFFF;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  color-scheme: light;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 55%, #FFFFFF 100%);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
  border-right: 1px solid var(--color-border);
}

.sidebar-logo {
  padding: 1.2rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav .nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.55;
  padding: 0 0.6rem;
  margin: 0.6rem 0 0.3rem;
}

.sidebar-nav .nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.6rem 0.4rem;
  opacity: 0.7;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.855rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  position: relative;
}

.sidebar-nav a .nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.sidebar-nav a .nav-icon path,
.sidebar-nav a .nav-icon rect,
.sidebar-nav a .nav-icon circle {
  fill: currentColor;
  stroke: currentColor;
}

.sidebar-nav a:hover {
  background: rgba(8, 145, 178, 0.09);
  color: var(--color-accent);
  transform: translateX(2px);
}

.sidebar-nav a:hover .nav-icon { opacity: 1; }

.sidebar-nav a.active {
  background: rgba(8, 145, 178, 0.13);
  color: var(--color-accent);
  font-weight: 600;
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--color-accent);
  border-radius: 0 3px 3px 0;
}

/* App Switcher */
.app-switcher {
  padding: 0.65rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.app-switcher-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.5;
  margin-bottom: 0.45rem;
  padding: 0 0.2rem;
}

.app-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.app-switcher-item:hover {
  background: rgba(8, 145, 178, 0.07);
  color: var(--color-accent);
}

.app-switcher-item.active {
  background: rgba(8, 145, 178, 0.11);
  color: var(--color-accent);
  font-weight: 600;
}

.app-switcher-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.app-switcher-item.active .app-switcher-icon {
  background: rgba(8, 145, 178, 0.18);
}

.app-switcher-item:hover .app-switcher-icon {
  background: rgba(8, 145, 178, 0.15);
}

.app-switcher-icon svg {
  width: 15px;
  height: 15px;
  color: currentColor;
}

.app-switcher-name {
  flex: 1;
}

.app-switcher-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-accent, #0891b2);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
  text-transform: uppercase;
}

.sidebar-raise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0.85rem 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--color-accent, #0891b2), #0e7490);
  color: #fff;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(8,145,178,0.25);
  transition: box-shadow 0.15s ease, transform 0.1s ease, background 0.15s;
  letter-spacing: 0.01em;
}
.sidebar-raise-btn:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  box-shadow: 0 4px 16px rgba(8,145,178,0.35);
  transform: translateY(-1px);
}

.sidebar-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(8,145,178,0.2);
}

.sidebar-footer-info { min-width: 0; flex: 1; }

.sidebar-footer-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-role {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ═══════════════════════════════════════
   MAIN CONTENT & TOPBAR
═══════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--color-bg);
}

.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-logo { width: 26px; height: 26px; object-fit: contain; }

.topbar-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem 0.28rem 0.35rem;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  max-width: 200px;
}

.topbar-user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #FFFFFF;
  text-transform: uppercase;
  flex-shrink: 0;
}

.page-content {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* ═══════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════ */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.2rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: rgba(8, 145, 178, 0.3);
}

.stat-card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: rgba(8, 145, 178, 0.12);
}

.stat-card-body { flex: 1; min-width: 0; }

.stat-card .stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}

.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(8,145,178,0.35);
}
.btn-primary:hover {
  background: #0780A0;
  box-shadow: 0 4px 12px rgba(8,145,178,0.3);
}

.btn-secondary {
  background: var(--color-accent-2);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(3,105,161,0.35);
}
.btn-secondary:hover {
  background: #024E8C;
  box-shadow: 0 4px 12px rgba(3,105,161,0.3);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.35);
}
.btn-danger:hover { background: var(--color-danger-dark); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: rgba(8, 145, 178, 0.08);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-sm  { padding: 0.28rem 0.65rem; font-size: 0.765rem; }
.btn-lg  { padding: 0.62rem 1.35rem; font-size: 0.9rem; }
.w-full  { width: 100%; }

/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.form-control:disabled {
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: not-allowed;
  border-color: var(--color-border);
}

.form-control::placeholder { color: var(--color-text-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-error {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: 0.3rem;
}

/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

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

thead tr { background: var(--color-bg); }

th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1.5px solid var(--color-border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

tbody tr { transition: background 0.1s; }
tbody tr:hover { background: rgba(8, 145, 178, 0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Status */
.badge-new        { background: rgba(100,116,139,0.2); color: var(--color-text-muted); }
.badge-open       { background: rgba(6,182,212,0.15); color: var(--color-accent-2); }
.badge-in-progress{ background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-resolved   { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-closed     { background: rgba(100,116,139,0.15); color: var(--color-text-muted); }
.badge-pending    { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-approved   { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-rejected   { background: rgba(239,68,68,0.15); color: var(--color-danger); }
.badge-escalated  { background: rgba(139,92,246,0.15); color: var(--color-purple); }
.badge-info       { background: rgba(6,182,212,0.15); color: var(--color-accent-2); }

/* Priority */
.badge-low      { background: rgba(16,185,129,0.15); color: var(--color-success); }
.badge-medium   { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.badge-high     { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-critical { background: rgba(239,68,68,0.2); color: var(--color-danger); }

/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-left-width: 3px;
  line-height: 1.5;
}

.alert-success {
  background: rgba(5, 150, 105, 0.08);
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.2);
  border-left-color: var(--color-success);
}

.alert-error {
  background: rgba(220, 38, 38, 0.08);
  color: #991B1B;
  border-color: rgba(220, 38, 38, 0.2);
  border-left-color: var(--color-danger);
}

.alert-info {
  background: rgba(8, 145, 178, 0.1);
  color: var(--color-accent);
  border-color: rgba(8, 145, 178, 0.25);
  border-left-color: var(--color-accent);
}

.alert-warning {
  background: rgba(217, 119, 6, 0.08);
  color: #92400E;
  border-color: rgba(217, 119, 6, 0.2);
  border-left-color: var(--color-warning);
}

/* ═══════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-brand {
  background: linear-gradient(155deg, #F8FAFC 0%, #F1F5F9 60%, #E8ECF1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(8, 145, 178, 0.04);
  pointer-events: none;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -25%; left: -15%;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(3, 105, 161, 0.04);
  pointer-events: none;
}

.auth-brand-logo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1), var(--glow-teal);
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

.auth-brand-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-brand-tagline {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.7;
  max-width: 280px;
  position: relative;
  z-index: 1;
}

.auth-brand-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.auth-brand-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.auth-form-panel {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-form-box {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.auth-form-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.auth-form-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
  text-align: center;
  font-weight: 500;
}

/* Logo for single-column login */
.auth-form-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: none;
  border: none;
  background: transparent;
  display: inline-block;
}

/* Override max-width for wider single-col form */
.auth-form-box {
  padding: 2.5rem;
  max-width: 520px;
}

/* Legacy compat */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 1rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

.auth-logo { display: block; margin: 0 auto 1.25rem; width: 90px; height: auto; }
.auth-logo--large { width: 100px; }
.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* ── Microsoft button ── */
.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-microsoft:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xs);
}

/* ── Divider with text ── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1rem 0; }

.divider-text {
  position: relative;
  text-align: center;
  margin: 1.1rem 0;
}
.divider-text::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  border-top: 1px solid var(--color-border);
}
.divider-text span {
  background: var(--color-surface);
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  position: relative;
}

/* ═══════════════════════════════════════
   SECTION TITLE (chart cards)
═══════════════════════════════════════ */
.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════
   BAR CHARTS (CSS only)
═══════════════════════════════════════ */
.bar-row { margin-bottom: 0.65rem; }

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.bar-track {
  background: rgba(203, 213, 225, 0.4);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
  min-width: 4px;
  background: linear-gradient(90deg, var(--color-accent), #06B6D4);
}

/* ═══════════════════════════════════════
   APPROVAL CHAIN
═══════════════════════════════════════ */
.approval-step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.approval-step:last-child { border-bottom: none; }

.approval-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.approval-step-info { flex: 1; min-width: 0; }
.approval-step-level { font-size: 0.82rem; font-weight: 600; color: var(--color-text-primary); }
.approval-step-role  { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 1px; }

/* ═══════════════════════════════════════
   COMMENT THREAD
═══════════════════════════════════════ */
.comment-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-item:last-child { border-bottom: none; }

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.comment-time { font-size: 0.72rem; color: var(--color-text-muted); }
.comment-body { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.55; }

/* ═══════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════ */
.admin-panel-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-xs);
}
.admin-panel-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: rgba(8, 145, 178, 0.4);
}
.admin-panel-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  background: rgba(8, 145, 178, 0.1);
}

/* ═══════════════════════════════════════
   APPROVAL BANNER
═══════════════════════════════════════ */
.approval-banner {
  background: rgba(8, 145, 178, 0.07);
  border: 1px solid rgba(8, 145, 178, 0.25);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}
.empty-state-text { font-size: 0.83rem; color: var(--color-text-muted); }

/* ═══════════════════════════════════════
   GRID HELPERS
═══════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* ═══════════════════════════════════════
   UTILITIES
═══════════════════════════════════════ */
.text-muted    { color: var(--color-text-muted); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-primary  { color: var(--color-accent); }
.text-secondary{ color: var(--color-accent-2); }
.text-danger   { color: var(--color-danger); }
.text-center   { text-align: center; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-content { padding: 1.25rem; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
}

/* ============================================================
   Kanban Board
   ============================================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  min-height: 400px;
}

.kanban-column {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 10px 10px 0 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.kanban-column-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kanban-column-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  min-width: 1.5rem;
  text-align: center;
}

.kanban-column-body {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-card {
  display: block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}

.kanban-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--glow-teal);
}

.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
}

.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 80px;
  opacity: 0.5;
}

@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   TASK PROGRESS SECTION
═══════════════════════════════════════ */
.task-progress-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
}

.task-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.task-progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-progress-badge {
  display: inline-block;
  background: rgba(8, 145, 178, 0.12);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

.task-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.task-input-group .form-control {
  flex: 1;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
}

.task-input-group .btn {
  flex-shrink: 0;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.task-item:hover {
  background: var(--color-surface-hover);
  border-color: rgba(8, 145, 178, 0.3);
}

.task-item.task-done {
  opacity: 0.6;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 0.875rem;
  color: var(--color-text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.task-item.task-done .task-text {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.task-priority {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.task-priority.high {
  background: rgba(220, 38, 38, 0.15);
  color: #991B1B;
}

.task-priority.medium {
  background: rgba(217, 119, 6, 0.15);
  color: #92400e;
}

.task-priority.low {
  background: rgba(107, 114, 128, 0.15);
  color: #374151;
}

.task-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-top: 0.25rem;
}

.task-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.task-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
}

.task-close-btn:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
}

.task-empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.task-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
  font-size: 0.8rem;
}

.task-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.task-stat-value {
  font-weight: 600;
  color: var(--color-text-primary);
}

.task-stat-label {
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════
   OLLAMA BOT WIDGET
═══════════════════════════════════════ */
.bot-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  font-family: inherit;
}

.bot-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.35);
  transition: all 0.3s ease;
}

.bot-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
}

.bot-toggle-btn.open {
  transform: rotate(45deg);
}

.bot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #EF4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 600;
}

.bot-container {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 500px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
}

.bot-container.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bot-header {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: white;
  padding: 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.bot-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.bot-header-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.bot-header-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bot-message {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message.user {
  justify-content: flex-end;
}

.bot-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: rgba(8, 145, 178, 0.12);
  color: var(--color-accent);
}

.bot-message.user .bot-message-avatar {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-text-muted);
  order: 2;
}

.bot-message-bubble {
  max-width: 280px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.bot-message.user .bot-message-bubble {
  background: var(--color-accent);
  color: white;
  border: none;
}

.bot-message.loading .bot-message-bubble {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.bot-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--color-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.bot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-8px); }
}

.bot-input-group {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.bot-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.bot-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.bot-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.bot-send-btn:hover:not(:disabled) {
  background: #0780A0;
}

.bot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bot-status {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.5rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: rgba(107, 114, 128, 0.05);
}

.bot-status.error {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.05);
}

.bot-status.connected {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.05);
}

@media (max-width: 480px) {
  .bot-widget {
    bottom: 1rem;
    right: 1rem;
  }

  .bot-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    bottom: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .bot-toggle-btn {
    width: 48px;
    height: 48px;
  }
}
