:root {
  --app-navy: #0f172a;
  --app-navy-2: #17233d;
  --app-blue: #2563eb;
  --app-blue-dark: #1d4ed8;
  --app-bg: #f1f5f9;
  --app-border: #e2e8f0;
  --app-text: #0f172a;
  --app-muted: #64748b;
}

html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--app-bg); color: var(--app-text); font-family: Inter, "Segoe UI", Arial, sans-serif; }
.app-navbar { min-height: 68px; background: linear-gradient(135deg, var(--app-navy), var(--app-navy-2)); box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.app-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.app-brand:hover { color: #fff; }
.app-brand strong, .app-brand small { display: block; line-height: 1.05; }
.app-brand strong { font-size: 17px; letter-spacing: -.2px; }
.app-brand small { margin-top: 3px; color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg,#38bdf8,#2563eb); color: #fff; font-weight: 800; box-shadow: 0 8px 18px rgba(37,99,235,.35); }
.app-menu { gap: 3px; }
.app-menu .nav-link { margin: 0 2px; padding: 9px 12px !important; border-radius: 8px; color: #cbd5e1 !important; font-size: 14px; font-weight: 600; }
.app-menu .nav-link:hover, .app-menu .nav-link.active { color: #fff !important; background: rgba(255,255,255,.09); }
.app-user-menu { display: flex; align-items: center; gap: 10px; }
.app-user-info { display: flex; align-items: center; gap: 8px; color: #fff; }
.app-user-info small, .app-user-info strong { display: block; }
.app-user-info small { color: #94a3b8; font-size: 10px; }
.app-user-info strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.app-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #334155; border: 1px solid #475569; color: #fff; font-weight: 800; }
.btn-logout { border: 1px solid #475569; color: #e2e8f0; background: transparent; }
.btn-logout:hover { color: #fff; border-color: #94a3b8; background: rgba(255,255,255,.06); }
.app-main { min-height: calc(100vh - 120px); }
.app-footer { min-height: 52px; border-top: 1px solid var(--app-border); background: #fff; color: var(--app-muted); font-size: 12px; }
.app-footer .container-fluid { min-height: 52px; display: flex; align-items: center; justify-content: space-between; }
.app-alert { border: 0; border-radius: 10px; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.app-alert.success { background: #ecfdf5; color: #166534; border-left: 4px solid #22c55e; }
.app-alert.danger { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.card { border: 1px solid var(--app-border); border-radius: 12px; box-shadow: 0 4px 16px rgba(15,23,42,.045); }
.card-header { background: #fff; border-bottom: 1px solid var(--app-border); font-weight: 700; }
.table { --bs-table-bg: #fff; margin-bottom: 0; }
.table th { border-bottom: 1px solid var(--app-border); color: var(--app-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .35px; white-space: nowrap; }
.table td { vertical-align: middle; border-color: #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }
.form-control, .form-select { min-height: 42px; border-radius: 8px; border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.btn { border-radius: 8px; font-weight: 600; }
.btn-primary { background: var(--app-blue); border-color: var(--app-blue); }
.btn-primary:hover { background: var(--app-blue-dark); border-color: var(--app-blue-dark); }
.badge { font-weight: 700; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-title h1, .page-title h2 { margin: 0; letter-spacing: -.5px; }
.page-title p { margin: 4px 0 0; color: var(--app-muted); }
.kpi-card { border: 0; min-height: 128px; overflow: hidden; position: relative; }
.kpi-card::after { content: ""; width: 90px; height: 90px; position: absolute; right: -28px; bottom: -38px; border-radius: 50%; background: rgba(255,255,255,.13); }
.kpi-card h6 { opacity: .85; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.kpi-card h2 { font-size: 34px; font-weight: 800; }
.status-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; }
.status-blue { background: #dbeafe; color: #1d4ed8; }
.status-red { background: #fee2e2; color: #b91c1c; }
.status-green { background: #dcfce7; color: #166534; }
.status-gray { background: #e2e8f0; color: #475569; }
.status-yellow { background: #fef3c7; color: #92400e; }
.ticket-thread { border-radius: 10px; border: 1px solid var(--app-border); background: #fff; padding: 14px; margin-bottom: 10px; }
.ticket-thread.internal { background: #fffbeb; border-color: #fde68a; }
.ticket-meta { color: var(--app-muted); font-size: 12px; }
@media (max-width: 991.98px) { .app-menu { margin: 10px 0; } .app-user-menu { justify-content: space-between; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; } }
