/* =====================================================================
   IT Helpdesk & Ticketing System - Design System
   Modern, mobile-first, sesuai PRD (Responsive + Low barrier to entry)
   ===================================================================== */

:root {
    --brand-1: #4f46e5;
    --brand-2: #7c3aed;
    --brand-3: #6366f1;
    --brand-soft: #eef2ff;
    --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --ink: #1e293b;
    --muted: #64748b;
    --bg: #e9edf6;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --radius: 1rem;
    --radius-sm: .7rem;
    --shadow-soft: 0 10px 30px -12px rgba(30, 41, 59, .18);
    --shadow-hover: 0 18px 40px -16px rgba(79, 70, 229, .35);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 520px at 100% -5%, rgba(124, 58, 237, .18), transparent 55%),
        radial-gradient(820px 480px at -5% 4%, rgba(79, 70, 229, .16), transparent 55%),
        linear-gradient(160deg, #e8ecfb 0%, #eeecfd 28%, #eef1f8 55%, #e9f0fb 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -.015em;
}

a {
    text-decoration: none;
}

.text-muted {
    color: var(--muted) !important;
}

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.navbar-app {
    background: var(--brand-gradient);
    box-shadow: 0 10px 24px -14px rgba(79, 70, 229, .8);
}

.navbar-app .navbar-brand {
    font-weight: 800;
    letter-spacing: -.02em;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.navbar-app .navbar-brand .brand-badge {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: .6rem;
    background: rgba(255, 255, 255, .18);
    font-size: 1.05rem;
}

.navbar-app .nav-link {
    color: rgba(255, 255, 255, .82) !important;
    font-weight: 500;
    border-radius: .6rem;
    padding: .45rem .85rem !important;
    transition: background-color .15s ease, color .15s ease;
}

.navbar-app .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .14);
}

.navbar-app .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, .22);
}

.navbar-app .dropdown-menu {
    border: none;
    border-radius: .8rem;
    box-shadow: var(--shadow-soft);
    padding: .4rem;
}

.navbar-app .dropdown-item {
    border-radius: .55rem;
    padding: .5rem .75rem;
    font-weight: 500;
}

.navbar-app .dropdown-item:hover {
    background: var(--brand-soft);
    color: var(--brand-1);
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--brand-gradient);
    color: #fff;
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-soft);
}

.hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.hero::before {
    content: "";
    position: absolute;
    right: 60px;
    bottom: -80px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.hero h1,
.hero p {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.hero .hero-icon {
    font-size: 2.4rem;
    line-height: 1;
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.card-header.bg-primary,
.card-header.bg-gradient-brand {
    background: var(--brand-gradient) !important;
    border-bottom: none;
    color: #fff;
}

.card-hover {
    transition: transform .18s ease, box-shadow .18s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    border-radius: .7rem;
    font-weight: 600;
    padding: .55rem 1.05rem;
}

.btn-primary {
    background: var(--brand-gradient);
    border: none;
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.btn-outline-primary {
    color: var(--brand-1);
    border-color: var(--brand-3);
}

.btn-outline-primary:hover {
    background: var(--brand-1);
    border-color: var(--brand-1);
}

.btn-lg {
    padding: .8rem 1.4rem;
    border-radius: .8rem;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: .9rem;
    margin-bottom: .35rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line-strong);
    padding: .6rem .85rem;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-3);
    box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .18);
    background-color: #fff;
}

.input-icon-group .input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--brand-soft);
    border: 1.5px solid var(--line-strong);
    color: var(--brand-1);
}

.input-icon-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-hint {
    font-size: .8rem;
    color: var(--muted);
}

/* ---------------------------------------------------------------------
   Stat cards (dashboard)
   --------------------------------------------------------------------- */
.stat-card {
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}

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

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: .85rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 600;
}

.stat-icon.tone-total { background: #eef2ff; color: #4f46e5; }
.stat-icon.tone-open { background: #fee2e2; color: #dc2626; }
.stat-icon.tone-progress { background: #fef3c7; color: #d97706; }
.stat-icon.tone-pending { background: #cffafe; color: #0891b2; }
.stat-icon.tone-resolved { background: #dcfce7; color: #16a34a; }
.stat-icon.tone-closed { background: #e2e8f0; color: #475569; }

/* ---------------------------------------------------------------------
   Badges & status pills
   --------------------------------------------------------------------- */
.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .42em .75em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.status-pill::before {
    content: "";
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: currentColor;
    opacity: .85;
}

.role-pill {
    border-radius: 999px;
    padding: .35em .7em;
    font-weight: 600;
    font-size: .75rem;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table {
    margin-bottom: 0;
    --bs-table-hover-bg: #f8faff;
}

.table > thead th {
    background: #f8fafc;
    color: var(--muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .06em;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table > tbody > tr > td {
    vertical-align: middle;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.table-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------------------
   Timeline (riwayat penanganan)
   --------------------------------------------------------------------- */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 1.85rem;
    padding-bottom: 1.35rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: .4rem;
    top: 1.1rem;
    bottom: -.1rem;
    width: 2px;
    background: var(--line);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item .timeline-dot {
    position: absolute;
    left: 0;
    top: .2rem;
    width: .85rem;
    height: .85rem;
    border-radius: 50%;
    background: var(--brand-gradient);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ---------------------------------------------------------------------
   Auth (login) page
   --------------------------------------------------------------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.auth-brand {
    background: var(--brand-gradient);
    color: #fff;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.auth-brand .auth-logo {
    width: 62px;
    height: 62px;
    margin: 0 auto .75rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    background: rgba(255, 255, 255, .18);
}

/* ---------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.empty-state .empty-icon {
    font-size: 2.6rem;
    color: #cbd5e1;
    display: block;
    margin-bottom: .5rem;
}

/* ---------------------------------------------------------------------
   Alerts
   --------------------------------------------------------------------- */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.app-footer {
    color: var(--muted);
    font-size: .82rem;
}

.app-footer .footer-brand {
    font-weight: 700;
    color: var(--brand-1);
}

/* ---------------------------------------------------------------------
   Misc helpers
   --------------------------------------------------------------------- */
.page-title {
    font-weight: 800;
    letter-spacing: -.02em;
}

.section-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--brand-1);
}

.soft-divider {
    height: 1px;
    background: var(--line);
    border: 0;
    opacity: 1;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--brand-soft);
    color: var(--brand-1);
    border-radius: 999px;
    padding: .3rem .7rem;
    font-weight: 600;
    font-size: .8rem;
}

@media (max-width: 576px) {
    .hero {
        padding: 1.5rem 1.25rem;
    }
    .stat-card {
        padding: .85rem .9rem;
    }
    .table > tbody > tr > td {
        white-space: nowrap;
    }
}
