/* =============================================================
   Surat Jalan Beton - Custom Styles
   Built on top of Bootstrap 5
   ============================================================= */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1f2a3a;
    --sidebar-hover: #2c3a4f;
    --sidebar-active: #0d6efd;
    --topbar-height: 60px;
    --footer-height: 50px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f9;
    margin: 0;
}

/* ============ APP LAYOUT ============ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cbd3da;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 18px 20px;
    background: rgba(0,0,0,0.2);
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header i { font-size: 1.4rem; color: #4dabff; }

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #cbd3da;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    font-size: 0.93rem;
}
.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav li.active a {
    background: rgba(13, 110, 253, 0.18);
    color: #fff;
    border-left-color: var(--sidebar-active);
}
.sidebar-nav li a i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-nav .nav-section {
    padding: 14px 20px 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c7a8a;
    font-weight: 600;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ============ TOPBAR ============ */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    flex: 1;
}
.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #555;
    cursor: pointer;
    padding: 4px 8px;
}
.topbar-user .dropdown-toggle { color: #333; }
.topbar-user .dropdown-toggle::after { display: none; }

/* ============ CONTENT AREA ============ */
.content-area {
    padding: 20px;
    flex: 1;
}

/* ============ FOOTER (sticky bottom) ============ */
.app-footer {
    background: #fff;
    border-top: 1px solid #e3e6ea;
    padding: 12px 20px;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ============ STAT CARDS ============ */
.stat-card {
    border-radius: 10px !important;
    transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-number {
    font-size: 1.7rem;
    font-weight: 700;
    color: #2c3a4f;
    line-height: 1.2;
}
.stat-icon { font-size: 2rem; opacity: 0.85; }

/* ============ LOGIN PAGE ============ */
.login-page {
    background: linear-gradient(135deg, #1f2a3a 0%, #2c3a4f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-wrapper { width: 100%; max-width: 420px; }
.login-card {
    background: #fff;
    padding: 36px 30px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-header { text-align: center; margin-bottom: 26px; }
.login-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}
.login-header h1 { font-size: 1.3rem; margin: 0; color: #2c3a4f; font-weight: 700; }
.login-footer { margin-top: 20px; text-align: center; }

/* ============ TABLES ============ */
.table thead th {
    background: #f8f9fb;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}
.table-hover tbody tr:hover { background: #f8f9fb; }

/* ============ FORM ============ */
.form-label { font-weight: 500; font-size: 0.9rem; }
.form-control:focus, .form-select:focus {
    border-color: #80b4ff;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
}

/* ============ BADGE STATUS ============ */
.badge-status-open        { background: #6c757d; }
.badge-status-on_progress { background: #0d6efd; }
.badge-status-selesai     { background: #198754; }
.badge-status-closed      { background: #343a40; }

/* ============ RESPONSIVE ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ============ SCROLLBAR ============ */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.list-scroll {
    max-height: 24rem;
    overflow-y: auto;
}
.list-scroll::-webkit-scrollbar { width: 8px; }
.list-scroll::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 4px; }
