﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* LOGIN */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    font-weight: bold;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--text);
}

.login-box .subtitle {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 28px;
}

.login-box h2 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 6px;
        color: var(--text);
    }

.input-wrapper {
    position: relative;
}

    .input-wrapper i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
        font-size: 14px;
    }

    .input-wrapper input {
        width: 100%;
        padding: 12px 14px 12px 40px;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.2s;
    }

        .input-wrapper input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
        }

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

    .remember-row input {
        cursor: pointer;
    }

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.login-footer {
    margin-top: 16px;
    font-size: 13px;
}

    .login-footer a {
        color: var(--primary);
        text-decoration: none;
        cursor: pointer;
    }

        .login-footer a:hover {
            text-decoration: underline;
        }

/* LOCK SCREEN */
.lock-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lock-box {
    text-align: center;
    color: white;
}

.lock-icon {
    width: 100px;
    height: 100px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
}

.lock-box h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.lock-box p {
    color: #94a3b8;
    margin-bottom: 24px;
}

.lock-box .input-wrapper input {
    padding-left: 14px;
    color: var(--text);
}

.lock-box .btn-primary {
    margin-top: 12px;
}

/* LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-close {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-backdrop {
    display: none;
}

    .sidebar-header .logo-icon {
        width: 36px;
        height: 36px;
        background: var(--primary);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: bold;
    }

    .sidebar-header span {
        font-size: 16px;
        font-weight: 600;
    }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .nav-item:hover, .nav-item.active {
        background: var(--sidebar-hover);
        color: white;
    }

    .nav-item.active {
        background: var(--primary);
    }

    .nav-item i {
        width: 20px;
        text-align: center;
    }

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-item.danger {
    color: #f87171;
}

    .nav-item.danger:hover {
        background: rgba(239,68,68,0.2);
    }

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--card-bg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
}

.topbar-title {
    font-size: 20px;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.user-info {
    text-align: right;
}

    .user-info .name {
        font-weight: 600;
    }

    .user-info .role {
        color: var(--text-light);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.content-area {
    padding: 24px;
    flex: 1;
}

/* DASHBOARD CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(var(--stats-cols, 4), 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

    .stat-icon.blue {
        background: var(--primary);
    }

    .stat-icon.green {
        background: var(--success);
    }

    .stat-icon.purple {
        background: #8b5cf6;
    }

    .stat-icon.orange {
        background: var(--warning);
    }

    .stat-icon.red {
        background: var(--danger);
    }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-light);
}

/* TABLES & CARDS */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .card-header h3 {
        font-size: 16px;
        font-weight: 600;
    }

.card-body {
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th, .data-table td {
        padding: 12px 16px;
        text-align: left;
        font-size: 13px;
        border-bottom: 1px solid var(--border);
    }

    .data-table th {
        background: #f8fafc;
        font-weight: 600;
        color: var(--text-light);
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .data-table tr:hover {
        background: #f8fafc;
    }

    .data-table th.sortable-header {
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
    }

        .data-table th.sortable-header:hover {
            color: var(--text);
        }

    .data-table tr.selected-row {
        background: #eff6ff;
    }

/* MOBILE CARD LIST (shown instead of .data-table on narrow screens) */
.mobile-cards {
    display: none;
}

.mobile-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

    .mobile-card.selected-row {
        background: #eff6ff;
    }

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

    .mobile-card-header strong {
        font-size: 14px;
        line-height: 1.3;
    }

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

    .mobile-card-body i {
        width: 16px;
        text-align: center;
        margin-right: 6px;
        color: var(--text-light);
    }

.mobile-card-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

    .mobile-card-actions a {
        font-size: 13px;
        color: var(--primary);
        text-decoration: none;
        padding: 6px 0;
    }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge-upitan {
    background: #ede9fe;
    color: #5b21b6;
}

/* ACTIVITY LOG */
.activity-list {
    padding: 8px 0;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-text {
    color: var(--text);
}

.activity-time {
    color: var(--text-light);
    font-size: 12px;
}

.activity-link {
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

    .activity-link:hover {
        text-decoration: underline;
    }

/* DASHBOARD LAYOUT */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* FILTER TABS */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
}

    .filter-tab.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

/* DI BADGE */
.di-badge {
    font-weight: 700;
}

    .di-badge.green {
        color: #166534;
    }

    .di-badge.orange {
        color: #92400e;
    }

    .di-badge.red {
        color: #991b1b;
    }

/* TOOLBAR */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-success {
    background: var(--success);
    color: white;
}

    .btn-success:hover {
        background: #16a34a;
    }

.btn-info {
    background: var(--info);
    color: white;
}

    .btn-info:hover {
        background: #2563eb;
    }

.btn-danger {
    background: var(--danger);
    color: white;
}

    .btn-danger:hover {
        background: #dc2626;
    }

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

    .btn-secondary:hover {
        background: #cbd5e1;
    }

.search-box {
    position: relative;
}

    .search-box input {
        padding: 8px 14px 8px 36px;
        border: 1px solid var(--border);
        border-radius: 6px;
        font-size: 13px;
        width: 240px;
    }

    .search-box i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
        font-size: 12px;
    }

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-box {
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        font-size: 16px;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

    .modal-footer .btn {
        width: auto;
        padding: 8px 20px;
    }

/* FORM */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.euro-date-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .euro-date-wrapper input[type="text"] {
        padding-right: 36px;
    }

.euro-date-native {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.euro-date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

    .form-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
    }

select.form-input {
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* PASSWORD REQUIREMENTS */
.password-reqs {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
}

    .password-reqs li {
        list-style: none;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .password-reqs li::before {
            content: "\f00c";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            color: var(--success);
        }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .data-table:has(+ .mobile-cards) {
        display: none;
    }

    .card-body {
        overflow-x: auto;
    }

    .mobile-cards {
        display: block;
    }

    .toolbar > div:first-child {
        width: 100%;
        flex-wrap: wrap;
    }

        .toolbar > div:first-child .btn-sm,
        .toolbar > div:first-child label.btn-sm {
            flex: 1 1 100%;
            justify-content: center;
            padding: 12px 14px;
        }

    .search-box {
        width: 100%;
    }

        .search-box input {
            width: 100%;
            padding: 12px 14px 12px 38px;
        }

    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

        .filter-tab {
            flex-shrink: 0;
        }

    .modal-box {
        max-width: 100%;
        margin: 10px;
    }
}
