
:root {
    --navy: #102c50;
    --navy-light: #1e426b;
    --green: #00b894;
    --blue: #2563eb;
    --background: #f4f7fb;
    --text: #172b4d;
    --muted: #718096;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--navy);
    color: #fff;
    padding: 26px 15px;
}

.brand {
    font-size: 26px;
    font-weight: bold;
    margin: 4px 14px 42px;
}

.brand span {
    color: var(--green);
}

.sidebar-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #9fb7d2;
    padding: 0 14px;
    margin-bottom: 12px;
}

.sidebar a {
    display: block;
    color: #dce7f4;
    text-decoration: none;
    padding: 13px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--navy-light);
    color: white;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 76px;
    background: white;
    padding: 0 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5eaf1;
}

.topbar strong {
    font-size: 15px;
}

.user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout {
    border: none;
    border-radius: 7px;
    padding: 10px 15px;
    background: #e8f8f3;
    color: #00896e;
    cursor: pointer;
    font-weight: bold;
}

.logout:hover {
    background: #c8f3e6;
}

.content {
    padding: 30px 35px;
}

.page-title {
    font-size: 25px;
    margin: 0 0 7px;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 26px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card,
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(19, 39, 67, 0.04);
    border: 1px solid #edf0f4;
}

.stat-card {
    padding: 22px;
}

.stat-card .label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.stat-card .value {
    font-size: 26px;
    font-weight: bold;
    color: var(--blue);
}

.stat-card .value.green {
    color: var(--green);
}

.stat-card .value.orange {
    color: #f59e0b;
}

.details {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.panel {
    padding: 24px;
}

.panel h3 {
    font-size: 17px;
    margin: 0 0 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

th {
    color: #7c899b;
    font-weight: 600;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 25px 10px;
    font-size: 14px;
}

.status-item {
    padding: 15px;
    background: #f7f9fc;
    border-radius: 9px;
    margin-bottom: 12px;
    font-size: 13px;
}

.status-item strong {
    display: block;
    margin-bottom: 6px;
}

.status-new {
    color: #d97706;
}

.status-process {
    color: #2563eb;
}

.status-done {
    color: #059669;
}

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .brand {
        margin: 0 0 15px;
    }

    .sidebar nav {
        display: flex;
        overflow-x: auto;
        gap: 5px;
    }

    .sidebar a {
        white-space: nowrap;
    }

    .sidebar-label {
        display: none;
    }

    .topbar {
        padding: 15px;
    }

    .content {
        padding: 20px 15px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .value {
        font-size: 20px;
    }
}


/* ===== DATA KAMAR ===== */

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.page-heading .subtitle {
    margin-bottom: 0;
}

.btn-primary,
.btn-secondary,
.btn-edit,
.btn-delete {
    display: inline-block;
    border: none;
    border-radius: 7px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-primary {
    background: #00b894;
    color: white;
}

.btn-primary:hover {
    background: #009b7d;
}

.btn-secondary {
    background: #e9eef5;
    color: #34455b;
}

.btn-edit {
    background: #e8f0ff;
    color: #2563eb;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-delete:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-group form {
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.badge-empty {
    background: #d1fae5;
    color: #047857;
}

.badge-occupied {
    background: #fef3c7;
    color: #b45309;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-panel {
    max-width: 680px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 13px;
    border: 1px solid #d9e2ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00b894;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.table-responsive {
    overflow-x: auto;
}

.pagination-links {
    margin-top: 20px;
}

.pagination-links nav {
    max-width: 100%;
}

@media (max-width: 700px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .action-group {
        flex-wrap: wrap;
    }
}

/* =========================================================
   KOSTMATE RESPONSIVE PAGE WIDTH
   Desktop lebar, tablet dan mobile tetap nyaman
   ========================================================= */

:root {
    --km-page-max: 1440px;
    --km-page-gap: clamp(16px, 3vw, 48px);
}

/*
 * Container utama halaman.
 * Tidak full 100%, tetapi memanfaatkan layar desktop dengan baik.
 */
.container,
.page-container,
.content-container,
.dashboard-container,
.home-container,
.catalog-container {
    width: calc(100% - (var(--km-page-gap) * 2));
    max-width: var(--km-page-max);
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   DESKTOP BESAR
   ========================================================= */

@media (min-width: 1600px) {

    :root {
        --km-page-max: 1480px;
        --km-page-gap: 40px;
    }

}


/* =========================================================
   LAPTOP / DESKTOP NORMAL
   ========================================================= */

@media (max-width: 1200px) {

    :root {
        --km-page-gap: 24px;
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    :root {
        --km-page-gap: 20px;
    }

    .summary-grid,
    .stats-grid,
    .dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    :root {
        --km-page-gap: 14px;
    }

    .container,
    .page-container,
    .content-container,
    .dashboard-container,
    .home-container,
    .catalog-container {
        width: calc(100% - 28px);
    }

    .summary-grid,
    .stats-grid,
    .dashboard-grid,
    .detail-grid,
    .billing-info {
        grid-template-columns:
            1fr !important;
    }

    h1,
    .page-title {
        font-size:
            clamp(22px, 7vw, 30px) !important;
    }

}


/* =========================================================
   SMALL PHONE
   ========================================================= */

@media (max-width: 400px) {

    :root {
        --km-page-gap: 10px;
    }

    .container,
    .page-container,
    .content-container,
    .dashboard-container,
    .home-container,
    .catalog-container {
        width: calc(100% - 20px);
    }

}

/* Final width override untuk user/public area */

body .container {
    max-width: 1440px;
}

@media (min-width: 1600px) {
    body .container {
        max-width: 1480px;
    }
}

@media (max-width: 640px) {
    body .container {
        width: calc(100% - 28px);
    }
}
