* {
    box-sizing: border-box;
}


/* =========================================================
   ROOT / VARIABLES
========================================================= */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;

    --text: #172033;
    --muted: #6b7280;

    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;

    --sidebar: #111827;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #1f2937;

    --success: #059669;
}


/* =========================================================
   GLOBAL
========================================================= */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);

    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   APP SHELL
========================================================= */

.app-shell {
    min-height: 100vh;

    display: flex;

    flex-direction: column;
}


/* =========================================================
   TOPBAR / HEADER
========================================================= */

.topbar {
    min-height: 70px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 28px;
}


/* =========================================================
   BRAND
========================================================= */

.brand {
    display: flex;

    align-items: center;

    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;

    border-radius: 9px;

    background: var(--primary);

    color: #ffffff;

    display: grid;

    place-items: center;

    font-weight: 700;

    font-size: 20px;
}

.brand-name {
    font-size: 15px;

    font-weight: 700;

    letter-spacing: .5px;
}

.brand-subtitle {
    color: var(--muted);

    font-size: 12px;

    margin-top: 2px;
}


/* =========================================================
   TOPBAR RIGHT SIDE
========================================================= */

.topbar-actions {
    display: flex;

    align-items: center;

    gap: 16px;
}


/* System Online */

.topbar-status {
    color: var(--muted);

    font-size: 13px;

    display: flex;

    align-items: center;

    gap: 7px;

    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;

    background: var(--success);

    border-radius: 50%;

    flex-shrink: 0;
}


/* Admin */

.admin-user {
    color: var(--text);

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;
}


/* Logout */

.logout-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    height: 34px;

    padding: 0 14px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: #ffffff;

    color: #374151;

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.logout-button:hover {
    background: #f3f4f6;

    border-color: #d1d5db;
}


/* =========================================================
   APP BODY
========================================================= */

.app-body {
    flex: 1;

    display: flex;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 230px;

    background: var(--sidebar);

    padding: 22px 14px;

    flex-shrink: 0;
}

.nav {
    display: flex;

    flex-direction: column;

    gap: 5px;
}

.nav a {
    color: var(--sidebar-text);

    padding: 11px 14px;

    border-radius: 8px;

    font-size: 14px;
}

.nav a:hover,
.nav a.active {
    background: var(--sidebar-active);

    color: #ffffff;
}

.nav-divider {
    height: 1px;

    background: #374151;

    margin: 14px 8px;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
    flex: 1;

    padding: 30px;

    max-width: 1400px;
}


/* =========================================================
   PAGE HEADING
========================================================= */

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0;

    font-size: 28px;
}

.page-heading p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   CARD
========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 24px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, .04);
}


/* =========================================================
   SUCCESS BOX
========================================================= */

.success-box {
    padding: 14px 16px;

    border-radius: 8px;

    background: #ecfdf5;

    color: #065f46;

    margin-bottom: 22px;
}


/* =========================================================
   DASHBOARD STATISTICS
========================================================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.stat-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 22px;
}

.stat-label {
    color: var(--muted);

    font-size: 14px;
}

.stat-value {
    margin-top: 8px;

    font-size: 30px;

    font-weight: 700;
}


/* =========================================================
   DASHBOARD SECTION HEADER
========================================================= */

.section-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;

    font-size: 22px;
}

.section-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   DATA TABLE
========================================================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: 10px;
}


.data-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}


/* Table Header */

.data-table th {
    padding: 13px 14px;

    text-align: left;

    background: #f9fafb;

    border-bottom: 1px solid var(--border);

    color: #4b5563;

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;
}


/* Table Body */

.data-table td {
    padding: 14px;

    border-bottom: 1px solid var(--border);

    color: var(--text);

    vertical-align: middle;
}


/* Remove border from last row */

.data-table tbody tr:last-child td {
    border-bottom: 0;
}


/* Hover */

.data-table tbody tr:hover {
    background: #fafafa;
}


/* =========================================================
   LICENSE CELL
========================================================= */

.data-table td strong {
    display: block;

    font-weight: 600;
}

.data-table td small {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   STATUS BADGE
========================================================= */

.status-badge {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 70px;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 600;
}


/* Active */

.status-active {
    background: #ecfdf5;

    color: #047857;
}


/* Expired */

.status-expired {
    background: #fef2f2;

    color: #b91c1c;
}


/* Inactive */

.status-inactive {
    background: #f3f4f6;

    color: #4b5563;
}


/* Suspended */

.status-suspended {
    background: #fff7ed;

    color: #c2410c;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
    padding: 35px 20px;

    text-align: center;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    min-height: 52px;

    background: var(--surface);

    border-top: 1px solid var(--border);

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 0 28px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .main-content {
        padding: 24px;
    }

    .stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 800px) {

    .topbar {
        padding: 0 16px;
    }


    .topbar-actions {
        gap: 8px;
    }


    .topbar-status {
        display: none;
    }


    .admin-user {
        font-size: 12px;
    }


    .logout-button {
        height: 32px;

        padding: 0 10px;

        font-size: 12px;
    }


    .app-body {
        display: block;
    }


    .sidebar {
        width: 100%;

        padding: 10px;
    }


    .nav {
        display: grid;

        grid-template-columns:
            repeat(2, 1fr);
    }


    .nav-divider {
        display: none;
    }


    .main-content {
        padding: 20px 16px;
    }


    .stats {
        grid-template-columns: 1fr;
    }


    /*
     * Table tetap bisa digeser
     * secara horizontal di HP.
     */

    .table-wrapper {
        overflow-x: auto;
    }


    .data-table {
        min-width: 850px;
    }


    .footer {
        padding: 14px 16px;

        gap: 8px;

        align-items: flex-start;

        flex-direction: column;
    }

}
/* =========================================================
   FORM
========================================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 14px;

    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    display: block;

    width: 100%;

    max-width: 650px;

    padding: 11px 12px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: #ffffff;

    color: var(--text);

    font-family: inherit;

    font-size: 14px;

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.form-group input {
    height: 42px;
}

.form-group textarea {
    min-height: 110px;

    resize: vertical;
}

.form-group select {
    height: 42px;

    max-width: 250px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(29, 78, 216, .10);
}

.form-group small {
    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   FORM ACTIONS
========================================================= */

.form-actions {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 25px;
}


/* Primary Button */

.button-primary {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    height: 40px;

    padding: 0 16px;

    border: 1px solid var(--primary);

    border-radius: 7px;

    background: var(--primary);

    color: #ffffff;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.button-primary:hover {
    background: var(--primary-dark);

    border-color: var(--primary-dark);
}


/* Secondary Button */

.button-secondary {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    height: 40px;

    padding: 0 16px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: #ffffff;

    color: #374151;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.button-secondary:hover {
    background: #f3f4f6;

    border-color: #d1d5db;
}


/* =========================================================
   FORM ERROR
========================================================= */

.error-box {
    margin-bottom: 20px;

    padding: 12px 14px;

    border: 1px solid #fecaca;

    border-radius: 8px;

    background: #fef2f2;

    color: #991b1b;

    font-size: 14px;
}


/* =========================================================
   MOBILE FORM
========================================================= */

@media (max-width: 800px) {

    .form-group input,
    .form-group textarea,
    .form-group select {
        max-width: 100%;
    }

    .form-actions {
        flex-direction: column;

        align-items: stretch;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

}