:root {
    --color-primary: #8b0000;
    --color-success: #006400;
    --color-bg: #f7f7f7;
    --color-text: #222222;
    --color-gray: #666666;
    --color-light-gray: #e0e0e0;
    --color-white: #ffffff;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #0dcaf0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
}

/* Cards */
.card {
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    display: inline-block;
    min-height: 48px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border: none;
    padding: 12px 24px;
    text-decoration: none;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn:active {
    opacity: 0.8;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-success {
    background-color: var(--color-success);
    color: var(--color-white);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-large {
    font-size: 20px;
    padding: 16px 32px;
    width: 100%;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--color-light-gray);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray);
}

.input-pl-icon {
    padding-left: 44px;
}

/* Alerts */
.alert {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card {
    padding: 30px 20px;
}

.login-title {
    font-size: 24px;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.login-icon svg {
    display: block;
    margin: 0 auto;
}

/* Dashboard Satpam */
.dashboard-header {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 24px 20px 48px 20px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    margin-bottom: -24px;
}

.shift-info {
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.shift-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-white);
}

.shift-badge-pagi {
    background-color: #f39c12;
}

.shift-badge-malam {
    background-color: #2c3e50;
}

.shift-badge-libur {
    background-color: var(--color-gray);
}

.attendance-btn {
    height: 80px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.status-done {
    color: var(--color-success);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pending {
    color: var(--color-gray);
    font-weight: 600;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-gray);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 8px;
    min-width: 64px;
}

.bottom-nav a svg {
    margin-bottom: 4px;
}

.bottom-nav a.active {
    color: var(--color-primary);
}

.bottom-nav a.active svg {
    stroke: var(--color-primary);
}

/* Admin Dashboard */
.admin-layout {
    display: flex;
    flex-direction: column;
}

.admin-header {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-sidebar {
    background-color: var(--color-white);
    padding: 20px;
    border-right: 1px solid var(--color-light-gray);
}

.admin-nav {
    list-style: none;
}

.admin-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 8px;
}

.admin-nav a:hover, .admin-nav a.active {
    background-color: rgba(139, 0, 0, 0.1);
    color: var(--color-primary);
}

.admin-content {
    padding: 20px;
    flex-grow: 1;
}

.stat-card {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    color: var(--color-gray);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-light-gray);
}

.data-table th {
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

/* History Cards */
.history-card {
    border-left: 4px solid var(--color-primary);
}

.history-date {
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-light-gray);
    padding-bottom: 8px;
}

.history-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Camera */
.camera-container {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

.camera-preview {
    width: 100%;
    max-width: 100%;
    display: block;
}

.camera-canvas {
    display: none;
}

.photo-preview {
    width: 100%;
    border-radius: 12px;
    display: none;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--color-gray); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-none { display: none !important; }
.d-block { display: block; }
.d-flex { display: flex; }
.hidden { display: none !important; }
.flex-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Responsive Adjustments */
@media (min-width: 769px) {
    .container {
        max-width: 960px;
    }
    
    .admin-layout {
        flex-direction: row;
        min-height: 100vh;
    }
    
    .admin-sidebar {
        width: 250px;
        flex-shrink: 0;
    }
    
    .bottom-nav {
        display: none; /* Hide mobile nav on desktop */
    }
    
    .dashboard-header {
        border-radius: 12px;
        margin-bottom: 24px;
    }
}

@media print {
    .bottom-nav, .admin-sidebar, .btn {
        display: none !important;
    }
    
    .card, .data-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
