/* =====================================================
   TIKET KONSUMSI — Main Stylesheet
   Elegant · Clean · Mobile-First
   ===================================================== */

/* ---- Variables ---- */
:root {
    --blue:       #2563eb;
    --blue-dark:  #1d4ed8;
    --blue-light: #eff6ff;
    --green:      #16a34a;
    --green-light:#f0fdf4;
    --yellow:     #d97706;
    --yellow-light:#fffbeb;
    --red:        #dc2626;
    --red-light:  #fef2f2;
    --gray-50:    #f9fafb;
    --gray-100:   #f3f4f6;
    --gray-200:   #e5e7eb;
    --gray-400:   #9ca3af;
    --gray-600:   #4b5563;
    --gray-800:   #1f2937;
    --white:      #ffffff;
    --shadow-xs:  0 1px 3px rgba(0,0,0,.08);
    --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* =====================================================
   NAVBAR
   ===================================================== */
#mainNav {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    box-shadow: 0 2px 12px rgba(37,99,235,.3);
    padding: .75rem 0;
}

#mainNav .navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: .3px;
}

#mainNav .navbar-brand i {
    font-size: 1.3rem;
}

#mainNav .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem .875rem !important;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: background .2s, color .2s;
}

#mainNav .nav-link i { font-size: 1rem; }

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
}

#mainNav .navbar-toggler {
    border: 1.5px solid rgba(255,255,255,.5);
    padding: .35rem .6rem;
}

#mainNav .navbar-toggler:focus { box-shadow: none; }

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content { flex: 1; }

/* Page Header */
.page-header { border-bottom: 1px solid var(--gray-200); padding-bottom: 1rem; }
.page-title  { font-size: 1.4rem; font-weight: 700; color: var(--gray-800); margin: 0 0 .2rem; }
.page-subtitle { font-size: .9rem; color: var(--gray-600); margin: 0; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--white) !important;
    color: var(--gray-800) !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-xs);
    margin-bottom: 1rem;
    transition: box-shadow .2s;
}

.card-header {
    background: var(--gray-50) !important;
    color: var(--gray-800) !important;
    border-bottom: 1px solid var(--gray-200) !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    font-weight: 600;
    font-size: .95rem;
    padding: .875rem 1.25rem;
}

.card-body {
    background: var(--white) !important;
    color: var(--gray-800) !important;
    padding: 1.25rem;
}

.card-footer {
    background: var(--gray-50) !important;
    border-top: 1px solid var(--gray-200) !important;
    padding: .875rem 1.25rem;
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat-card {
    border-radius: var(--radius-md) !important;
    border: none !important;
    padding: 1.5rem 1.25rem;
    color: var(--white) !important;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.stat-card .stat-icon  { font-size: 2rem; opacity: .9; margin-bottom: .4rem; }
.stat-card .stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1; margin-bottom: .25rem; }
.stat-card .stat-label { font-size: .85rem; opacity: .9; }

.stat-card-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-card-warning { background: linear-gradient(135deg, #b45309, #d97706); }
.stat-card-success { background: linear-gradient(135deg, #15803d, #16a34a); }

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.form-control,
.form-select {
    background: var(--white) !important;
    color: var(--gray-800) !important;
    border: 1.5px solid var(--gray-200) !important;
    border-radius: var(--radius-sm) !important;
    padding: .65rem .875rem !important;
    font-size: 1rem !important;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: auto;
    appearance: auto;
}

.form-control:focus,
.form-select:focus {
    background: var(--white) !important;
    color: var(--gray-800) !important;
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
    outline: none !important;
}

.form-control::placeholder { color: var(--gray-400) !important; }
.form-control:disabled, .form-select:disabled {
    background: var(--gray-100) !important;
    color: var(--gray-600) !important;
    cursor: not-allowed;
}

.form-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--gray-800) !important;
    margin-bottom: .375rem;
}

.form-text {
    font-size: .8rem;
    color: var(--gray-400) !important;
}

.invalid-feedback { font-size: .8rem; color: var(--red) !important; }
.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.1) !important;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .9rem;
    padding: .5rem 1.1rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

/* Primary */
.btn-primary {
    background: var(--blue) !important;
    color: var(--white) !important;
    border-color: var(--blue) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--blue-dark) !important;
    box-shadow: 0 4px 12px rgba(37,99,235,.3) !important;
    color: var(--white) !important;
}

/* Success */
.btn-success {
    background: var(--green) !important;
    color: var(--white) !important;
    border-color: var(--green) !important;
}
.btn-success:hover {
    background: #15803d !important;
    box-shadow: 0 4px 12px rgba(22,163,74,.25) !important;
    color: var(--white) !important;
}

/* Warning */
.btn-warning {
    background: #f59e0b !important;
    color: var(--gray-800) !important;
    border-color: #f59e0b !important;
}
.btn-warning:hover { background: #d97706 !important; color: var(--gray-800) !important; }

/* Danger */
.btn-danger {
    background: var(--red) !important;
    color: var(--white) !important;
    border-color: var(--red) !important;
}
.btn-danger:hover { background: #b91c1c !important; color: var(--white) !important; }

/* Outline variants */
.btn-outline-primary {
    background: var(--white) !important;
    color: var(--blue) !important;
    border: 1.5px solid var(--blue) !important;
}
.btn-outline-primary:hover, .btn-outline-primary.active {
    background: var(--blue) !important;
    color: var(--white) !important;
}

.btn-outline-secondary {
    background: var(--white) !important;
    color: var(--gray-600) !important;
    border: 1.5px solid var(--gray-200) !important;
}
.btn-outline-secondary:hover {
    background: var(--gray-100) !important;
    color: var(--gray-800) !important;
}

.btn-outline-danger {
    background: var(--white) !important;
    color: var(--red) !important;
    border: 1.5px solid var(--red) !important;
}
.btn-outline-danger:hover { background: var(--red) !important; color: var(--white) !important; }

/* Sizes */
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }

/* =====================================================
   ACTION BUTTONS (Edit/Hapus/Checklist)
   ===================================================== */
.action-btns {
    display: flex;
    gap: .375rem;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    border: none;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

.btn-action.edit   { background: #fef3c7; color: #92400e; }
.btn-action.edit:hover { background: #f59e0b; color: var(--white); }

.btn-action.delete { background: #fee2e2; color: #991b1b; }
.btn-action.delete:hover { background: var(--red); color: var(--white); }

.btn-action.check  { background: #dcfce7; color: #166534; }
.btn-action.check:hover { background: var(--green); color: var(--white); }

/* =====================================================
   TABLE
   ===================================================== */
.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.table {
    margin-bottom: 0;
    background: var(--white) !important;
    color: var(--gray-800) !important;
    font-size: .9rem;
}

.table thead th {
    background: var(--gray-50) !important;
    color: var(--gray-600) !important;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .875rem 1rem;
    border-bottom: 2px solid var(--gray-200) !important;
    white-space: nowrap;
}

.table tbody td {
    padding: .875rem 1rem;
    vertical-align: middle;
    background: var(--white) !important;
    color: var(--gray-800) !important;
    border-bottom: 1px solid var(--gray-100) !important;
}

.table tbody tr:last-child td { border-bottom: none !important; }
.table tbody tr:hover td { background: var(--blue-light) !important; }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    border-radius: 6px;
    padding: .3em .65em;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .2px;
}

.badge.bg-warning { background: var(--yellow-light) !important; color: var(--yellow) !important; border: 1px solid #fcd34d; }
.badge.bg-success { background: var(--green-light) !important; color: var(--green) !important; border: 1px solid #86efac; }
.badge.bg-secondary { background: var(--gray-100) !important; color: var(--gray-600) !important; }
.badge.bg-light { background: var(--gray-100) !important; color: var(--gray-600) !important; }

/* =====================================================
   CHECKLIST CARDS
   ===================================================== */
.checklist-card {
    border: 2px solid var(--gray-200) !important;
    background: var(--white) !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer;
    transition: all .25s;
    user-select: none;
}

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

.checklist-card[data-status="pending"] {
    border-color: #fcd34d !important;
    background: var(--yellow-light) !important;
}

.checklist-card[data-status="arrived"] {
    border-color: #86efac !important;
    background: var(--green-light) !important;
    opacity: .85;
}

.checklist-card .card-body { padding: 1rem !important; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    border-radius: var(--radius-sm);
    border: none !important;
    font-size: .9rem;
    font-weight: 500;
}
.alert-success { background: var(--green-light) !important; color: #166534 !important; border-left: 4px solid var(--green) !important; }
.alert-danger  { background: var(--red-light) !important;   color: #991b1b !important; border-left: 4px solid var(--red) !important; }
.alert-warning { background: var(--yellow-light) !important;color: #92400e !important; border-left: 4px solid var(--yellow) !important; }
.alert-info    { background: var(--blue-light) !important;  color: #1e40af !important; border-left: 4px solid var(--blue) !important; }

/* =====================================================
   PROGRESS
   ===================================================== */
.progress { border-radius: 99px; background: var(--gray-200); height: 8px; }
.progress-bar { border-radius: 99px; }

/* =====================================================
   LIST GROUP
   ===================================================== */
.list-group-item {
    background: var(--white) !important;
    color: var(--gray-800) !important;
    border-color: var(--gray-200) !important;
    font-size: .9rem;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    color: var(--gray-600);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-muted { color: var(--gray-400) !important; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }

/* =====================================================
   MOBILE — Touch Targets
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
    .btn       { min-height: 44px; }
    .btn-sm    { min-height: 38px; }
    .btn-lg    { min-height: 52px; }
    .form-control, .form-select { min-height: 48px; }
    .btn-action { width: 40px; height: 40px; font-size: 1rem; }

    .checklist-card .btn-success { min-height: 56px; font-size: 1rem; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 576px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .card-body  { padding: 1rem; }
    .page-title { font-size: 1.2rem; }

    /* Table jadi card style di mobile */
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards tbody tr {
        display: block;
        background: var(--white);
        border-radius: var(--radius-sm);
        border: 1px solid var(--gray-200);
        margin-bottom: .75rem;
        padding: .75rem;
        box-shadow: var(--shadow-xs);
    }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: .35rem .5rem !important;
        border: none !important;
        font-size: .88rem;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: .78rem;
        color: var(--gray-400);
        text-transform: uppercase;
        letter-spacing: .4px;
        min-width: 90px;
    }

    .action-btns { flex-wrap: wrap; }

    .stat-card .stat-value { font-size: 1.75rem; }

    #mainNav .nav-link { padding: .625rem .875rem !important; }
}

@media (max-width: 768px) {
    .table thead th, .table tbody td { padding: .65rem .75rem; }
}

/* =====================================================
   PWA standalone
   ===================================================== */
@media (display-mode: standalone) {
    body   { padding-top: env(safe-area-inset-top); }
    #mainNav { padding-top: calc(env(safe-area-inset-top) + .75rem); }
}

/* =====================================================
   Print
   ===================================================== */
@media print {
    body { background: var(--white); }
    #mainNav, .site-footer, .btn, .no-print { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* =====================================================
   Animation
   ===================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .35s ease forwards; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
