@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #f4f7fb;
    --bg-soft: #eef4ff;
    --card-bg: #ffffff;
    --text-main: #172033;
    --text-muted: #6b7280;
    --border-soft: rgba(15, 23, 42, 0.08);

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #e8f0ff;

    --success-soft: #dcfce7;
    --success-text: #166534;

    --warning-soft: #fef3c7;
    --warning-text: #92400e;

    --danger-soft: #fee2e2;
    --danger-text: #b91c1c;

    --shadow-sm: 0 10px 25px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(37, 99, 235, 0.10);

    --radius-lg: 18px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg-main) 100%);
    color: var(--text-main);
    min-height: 100vh;
}

/* =========================
   GLOBAL
========================= */
a {
    text-decoration: none;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 0;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.45;
}

.text-muted-soft {
    color: var(--text-muted);
}

/* =========================
   TOPBAR
========================= */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.app-brand:hover {
    color: var(--primary);
}

.app-brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.app-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
}

.app-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.app-user-meta {
    line-height: 1.15;
}

.app-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.app-user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================
   PAGE WRAP
========================= */
.page-shell {
    padding-top: 26px;
    padding-bottom: 30px;
}

.page-hero {
    margin-bottom: 22px;
}

.page-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #60a5fa 100%);
    color: #fff;
    border-radius: 28px;
    padding: 22px 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.page-hero-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    top: -80px;
    right: -70px;
    background: rgba(255, 255, 255, 0.10);
}

.page-hero-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    bottom: -40px;
    right: 80px;
    background: rgba(255, 255, 255, 0.08);
}

.page-hero-title {
    position: relative;
    z-index: 2;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.page-hero-desc {
    position: relative;
    z-index: 2;
    font-size: 14px;
    opacity: 0.92;
    margin: 0;
}

/* =========================
   CARDS
========================= */
.card {
    border: 0;
}

.card-login,
.card-dashboard,
.card-mobile,
.card-riwayat,
.mobile-menu-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.90);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-login .card-body,
.card-dashboard .card-body,
.card-mobile .card-body,
.card-riwayat .card-body,
.mobile-menu-card .card-body {
    padding: 22px;
}

.card-title-soft {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--text-main);
}

.stat-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(96, 165, 250, 0.02));
    pointer-events: none;
}

/* =========================
   HERO USER
========================= */
.mobile-hero {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 60%, #60a5fa 100%);
    color: #fff;
    border-radius: 28px;
    padding: 22px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.mobile-hero::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    right: -40px;
    top: -50px;
}

.mobile-hero h4 {
    position: relative;
    z-index: 2;
    margin: 0 0 8px 0;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.mobile-hero p {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.94;
}

/* =========================
   MENU CARD
========================= */
.mobile-menu-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mobile-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
    border-color: rgba(37, 99, 235, 0.14);
}

.mobile-menu-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    margin-bottom: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

/* =========================
   BADGE / STATUS
========================= */
.badge-soft {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.status-normal,
.status-telat,
.status-tidak {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.status-normal {
    background: var(--success-soft);
    color: var(--success-text);
}

.status-telat {
    background: var(--warning-soft);
    color: var(--warning-text);
}

.status-tidak {
    background: var(--danger-soft);
    color: var(--danger-text);
}

/* =========================
   BUTTONS
========================= */
.btn {
    border-radius: 14px;
    font-weight: 700;
    padding: 10px 16px;
    border: 0;
    transition: all .18s ease;
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2563eb);
    color: #fff;
}

.btn-outline-primary {
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: #fff;
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.btn-outline-secondary,
.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.btn-outline-success {
    border: 1px solid rgba(22, 101, 52, 0.15);
    background: #fff;
    color: var(--success-text);
}

.btn-outline-success:hover {
    background: #f0fdf4;
    color: var(--success-text);
}

.btn-outline-dark {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    color: var(--text-main);
}

.btn-outline-dark:hover {
    background: #f8fafc;
    color: var(--text-main);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
}

.btn-absen {
    border-radius: 18px;
    font-weight: 800;
    font-size: 17px;
    padding: 14px 18px;
    min-height: 54px;
}

/* =========================
   FORM
========================= */
.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    min-height: 50px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-main);
    background: rgba(255,255,255,0.98);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

textarea.form-control {
    min-height: 110px;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
}

.form-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

/* =========================
   ALERT
========================= */
.alert {
    border: 0;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
}

.alert-warning {
    background: #fff7e6;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* =========================
   TABLE
========================= */
.table-responsive {
    border-radius: 20px;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.table thead th {
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    white-space: nowrap;
}

.table td, 
.table th {
    vertical-align: middle;
    padding: 14px 14px;
    border-color: rgba(15, 23, 42, 0.06);
}

.table tbody td {
    font-size: 14px;
    color: var(--text-main);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.025);
}

.table .btn-sm {
    white-space: nowrap;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
}

/* =========================
   PHOTO PREVIEW
========================= */
.photo-preview-box {
    width: 100%;
    min-height: 240px;
    border: 2px dashed rgba(37, 99, 235, 0.18);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.photo-preview-box img {
    width: 100%;
    height: auto;
    display: none;
    object-fit: cover;
}

.photo-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* =========================
   IMAGE IN DETAIL CARD
========================= */
.card-dashboard img {
    max-height: 420px;
    object-fit: contain;
    background: #f8fafc;
    width: 100%;
    border-radius: 18px !important;
}

/* =========================
   STICKY BUTTON MOBILE
========================= */
.mobile-sticky-btn {
    position: sticky;
    bottom: 14px;
    z-index: 20;
}

/* =========================
   FOOTER
========================= */
.app-footer {
    padding: 18px 0 26px;
    color: var(--text-muted);
    font-size: 13px;
}

.app-footer-box {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 991.98px) {
    .page-title {
        font-size: 24px;
    }

    .page-hero-title {
        font-size: 24px;
    }
}

@media (max-width: 767.98px) {
    .page-shell {
        padding-top: 18px;
    }

    .page-hero-card,
    .mobile-hero {
        border-radius: 24px;
        padding: 18px;
    }

    .card-login .card-body,
    .card-dashboard .card-body,
    .card-mobile .card-body,
    .card-riwayat .card-body,
    .mobile-menu-card .card-body {
        padding: 18px;
    }

    .app-user-pill {
        padding: 7px 10px;
    }

    .app-user-name {
        font-size: 12px;
    }

    .btn {
        padding: 10px 14px;
    }

    .table tbody td,
    .table thead th {
        font-size: 12px;
        padding: 12px 10px;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-hero-title {
        font-size: 22px;
    }

    .mobile-hero h4 {
        font-size: 22px;
    }

    .form-control,
    .form-select,
    textarea.form-control {
        min-height: 48px;
    }

    .btn-absen {
        font-size: 16px;
    }

    .app-brand {
        font-size: 16px;
    }

    .app-brand-badge {
        width: 38px;
        height: 38px;
        border-radius: 13px;
        font-size: 14px;
    }

    .app-user-meta {
        display: none;
    }
}