/* ==================== LOGIN PAGE PROFESSIONAL STYLES ==================== */

/* Reset & Base */
* { box-sizing: border-box; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }

/* Login Container */
.setup-card {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Hero section kiri */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2b44 100%);
    position: relative;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" opacity="0.1"><path fill="white" d="M45.3 49.8c-9 8-9 22 0 30l36 36c9 9 23 9 32 0l36-36c9-8 9-22 0-30l-36-36c-9-8-23-8-32 0l-36 36z"/></svg>');
    background-repeat: repeat;
    background-size: 40px;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-highlight {
    color: #60a5fa;
    border-bottom: 3px solid #60a5fa;
}

.hero-desc {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 40px;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Form kanan */
.login-form {
    flex: 1;
    padding: 48px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    color: #0f172a;
}

.form-header p {
    color: #64748b;
    margin: 0;
}

.form-group {
    flex: 1;
    min-width: 120px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s;
}

.input-with-icon:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-icon {
    padding: 0 12px;
    font-size: 1.2rem;
}

.form-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 12px;
    font-size: 1rem;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    color: #1e293b;
}

.btn-outline:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-block {
    display: block;
    width: 100%;
    margin-top: 16px;
}

.form-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 30px);
    height: 1px;
    background: #e2e8f0;
}

.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

.form-divider span {
    background: white;
    padding: 0 16px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.app-status {
    margin-top: 24px;
    padding: 12px;
    text-align: center;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* ==================== DARK MODE LOGIN PAGE ==================== */
body.dark .login-form {
    background: #1e293b;
}

body.dark .login-form .form-header h2 {
    color: white;
}

body.dark .form-group label {
    color: #e2e8f0;
}

body.dark .input-with-icon {
    background: #334155;
    border-color: #475569;
}

body.dark .form-input {
    color: white;
}

body.dark .btn-outline {
    color: #e2e8f0;
    border-color: #475569;
}

body.dark .form-divider span {
    background: #1e293b;
    color: #94a3b8;
}

body.dark .form-divider::before,
body.dark .form-divider::after {
    background: #475569;
}

/* ==================== ORIGINAL APP STYLES (YANG SUDAH ADA) ==================== */

body { 
    background: #f3f4f6; 
    margin: 0; 
    padding: 16px; 
    transition: background 0.3s, color 0.3s; 
}

body.dark { 
    background: #1e1e2f; 
    color: #e2e2e2; 
}

body.dark .card { 
    background: #2a2a3a; 
}

body.dark input, body.dark select, body.dark button, body.dark textarea { 
    background: #3a3a4a; 
    color: #e2e2e2; 
    border-color: #555; 
}

body.dark .popup-content { 
    background: #2a2a3a; 
}

body.dark .member-tag, body.dark .store-tag { 
    background: #3a3a4a; 
}

body.dark .stat-card { 
    background: #3a3a4a; 
}

body.dark .stat-card-header { 
    background: #4a4a5a; 
}

body.dark .pending-card { 
    background: #2a2a3a; 
    border-color: #4a4a5a; 
}

body.dark .submission-item { 
    background: #3a3a4a; 
}

body.dark .total-approved { 
    background: #3a3a4a; 
}

body.dark .filter-bar select, body.dark .filter-bar input { 
    background: #3a3a4a; 
}

body.dark .edit-submission-card { 
    background: #2a2a3a; 
    border-color: #4a4a5a; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

.card { 
    background: white; 
    border-radius: 24px; 
    padding: 20px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    transition: background 0.3s; 
}

h2 { 
    font-size: 1.5rem; 
    margin: 0 0 12px 0; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-wrap: wrap; 
    gap: 8px; 
}

h3 { 
    font-size: 1.2rem; 
    margin: 0 0 12px 0; 
}

.flex-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    align-items: flex-end; 
}

input, select, button, textarea { 
    padding: 10px 12px; 
    border-radius: 14px; 
    border: 1px solid #cbd5e1; 
    font-size: 1rem; 
    background: white; 
}

textarea { 
    font-family: inherit; 
    resize: vertical; 
}

button { 
    width: 100%; 
    background: #6366f1; 
    color: white; 
    border: none; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s; 
}

button:hover { 
    background: #4f46e5; 
}

button:disabled { 
    background: #9ca3af; 
    cursor: not-allowed; 
}

.btn-inline { 
    width: auto; 
    display: inline-block; 
    padding: 4px 10px; 
    font-size: 0.8rem; 
    margin-left: 5px; 
}

.btn-secondary { 
    background: #f1f5f9; 
    color: #1e293b; 
    border: 1px solid #cbd5e1; 
}

body.dark .btn-secondary { 
    background: #4a4a5a; 
    color: #e2e2e2; 
    border-color: #666; 
}

.btn-danger { 
    background: #ef4444; 
}

.btn-warning { 
    background: #f59e0b; 
}

.btn-sm { 
    padding: 6px 12px; 
    font-size: 0.85rem; 
    width: auto; 
}

.btn-success { 
    background: #10b981; 
}

/* Avatar styling */
.avatar { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    color: white; 
    font-weight: bold; 
    flex-shrink: 0; 
}

/* Member card styles */
.today-schedule-card { 
    background: #f8fafc; 
    border-radius: 16px; 
    padding: 12px; 
    margin-bottom: 10px; 
    border-left: 4px solid #3b82f6; 
}

body.dark .today-schedule-card { 
    background: #3a3a4a; 
}

.today-schedule-store { 
    font-weight: bold; 
    font-size: 1rem; 
    margin-bottom: 4px; 
}

.today-schedule-date { 
    font-size: 0.75rem; 
    color: #64748b; 
    margin-bottom: 10px; 
}

.button-row { 
    display: flex; 
    flex-direction: row; 
    flex-wrap: nowrap; 
    gap: 6px; 
    margin-top: 10px; 
}

.button-row button { 
    flex: 1; 
    width: auto; 
    margin: 0; 
    padding: 6px 4px; 
    font-size: 0.7rem; 
    white-space: nowrap; 
    border-radius: 20px; 
}

@media (max-width: 480px) { 
    .button-row button { 
        font-size: 0.6rem; 
        padding: 6px 2px; 
    } 
}

/* Schedule card (slim design) */
.schedule-card { 
    background: #f8fafc; 
    border-radius: 12px; 
    padding: 8px 12px; 
    margin-bottom: 8px; 
    border: 1px solid #e2e8f0; 
}

body.dark .schedule-card { 
    background: #3a3a4a; 
    border-color: #4a4a5a; 
}

.schedule-row1 { 
    font-size: 0.85rem; 
    margin-bottom: 6px; 
}

.schedule-store { 
    font-weight: bold; 
}

.schedule-member { 
    color: #64748b; 
}

.schedule-row2 { 
    display: flex; 
    gap: 8px; 
    margin-top: 4px; 
}

.schedule-row2 button { 
    padding: 4px 8px; 
    font-size: 0.7rem; 
    width: auto; 
    border-radius: 12px; 
}

/* Stats grid */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    margin-top: 12px; 
}

@media (max-width: 480px) { 
    .stats-grid { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    } 
}

.stat-card { 
    background: #f1f5f9; 
    border-radius: 16px; 
    text-align: center; 
    font-size: 0.85rem; 
    overflow: hidden; 
}

.stat-card-header { 
    background: #cbd5e1; 
    padding: 8px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
}

.stat-card-body { 
    padding: 8px; 
}

/* Dark mode toggle */
.dark-toggle { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    background: #6366f1; 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 24px; 
    z-index: 1000; 
}

/* Filter bar */
.filter-bar { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin-bottom: 16px; 
    align-items: flex-end; 
}

.filter-bar select, .filter-bar input { 
    flex: 1; 
    min-width: 120px; 
}

/* Badges */
.badge { 
    background: #ef4444; 
    color: white; 
    border-radius: 20px; 
    padding: 2px 8px; 
    font-size: 0.7rem; 
    margin-left: 8px; 
    display: inline-block; 
}

.role-badge { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 20px; 
    font-size: 0.7rem; 
    margin-left: 8px; 
}

.role-admin { 
    background: #6366f1; 
    color: white; 
}

.role-spv { 
    background: #10b981; 
    color: white; 
}

.role-member { 
    background: #f59e0b; 
    color: white; 
}

.pending-badge { 
    background: #f59e0b; 
    color: white; 
    border-radius: 20px; 
    padding: 2px 8px; 
    font-size: 0.7rem; 
    display: inline-block; 
}

.approved-badge { 
    background: #10b981; 
    color: white; 
    border-radius: 20px; 
    padding: 2px 8px; 
    font-size: 0.7rem; 
    display: inline-block; 
}

.emergency-badge { 
    background: #ef4444; 
    color: white; 
    border-radius: 20px; 
    padding: 2px 8px; 
    font-size: 0.7rem; 
    display: inline-block; 
}

/* Pending cards (SPV) */
.pending-card { 
    background: #ffffff; 
    border-radius: 16px; 
    padding: 14px; 
    margin-bottom: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    border: 1px solid #e2e8f0; 
}

.pending-card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
    flex-wrap: wrap; 
    gap: 8px; 
}

.pending-member { 
    font-weight: bold; 
    font-size: 1rem; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.pending-amount { 
    font-weight: bold; 
    color: #3b82f6; 
}

.pending-card-details-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px 12px; 
    margin-bottom: 12px; 
    font-size: 0.75rem; 
    color: #64748b; 
}

.pending-card-buttons-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    margin-top: 8px; 
    padding-top: 8px; 
    border-top: 1px solid #e2e8f0; 
}

.pending-card-buttons-row button { 
    flex: 1; 
    min-width: 70px; 
    padding: 6px 8px; 
    font-size: 0.7rem; 
    border-radius: 20px; 
}

.btn-approve { 
    background: #10b981; 
}

.btn-reject { 
    background: #ef4444; 
}

/* Edit Submissions Cards */
.edit-submission-card { 
    background: white; 
    border-radius: 16px; 
    margin-bottom: 12px; 
    border: 1px solid #e2e8f0; 
    overflow: hidden; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}

.edit-submission-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 10px 12px; 
    transition: background 0.2s; 
}

.edit-submission-header.status-pending { 
    background: #fef3c7; 
}

.edit-submission-header.status-approved { 
    background: #d1fae5; 
}

.edit-submission-header.status-rejected { 
    background: #fee2e2; 
}

body.dark .edit-submission-header.status-pending { 
    background: #78350f; 
}

body.dark .edit-submission-header.status-approved { 
    background: #064e3b; 
}

body.dark .edit-submission-header.status-rejected { 
    background: #7f1d1d; 
}

.edit-submission-checkbox { 
    margin-right: 8px; 
    transform: scale(1.1); 
}

.edit-submission-info { 
    flex: 1; 
    font-size: 0.8rem; 
}

.edit-submission-member { 
    font-weight: bold; 
}

.edit-submission-store { 
    color: #4b5563; 
}

.edit-submission-amount { 
    font-weight: bold; 
    color: #1f2937; 
}

.edit-submission-details { 
    padding: 8px 12px; 
    font-size: 0.7rem; 
    color: #6b7280; 
    background: #f9fafb; 
    border-top: 1px solid #e2e8f0; 
}

body.dark .edit-submission-details { 
    background: #2a2a3a; 
    border-top-color: #4a4a5a; 
}

.edit-submission-actions { 
    display: flex; 
    gap: 8px; 
    padding: 8px 12px; 
    background: #f9fafb; 
    border-top: 1px solid #e2e8f0; 
}

body.dark .edit-submission-actions { 
    background: #2a2a3a; 
    border-top-color: #4a4a5a; 
}

.edit-submission-actions button { 
    padding: 4px 12px; 
    font-size: 0.7rem; 
    width: auto; 
    border-radius: 12px; 
}

/* Admin slim cards */
.admin-record-card { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 8px 12px; 
    margin-bottom: 6px; 
    background: #f8fafc; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
    transition: background 0.2s; 
}

body.dark .admin-record-card { 
    background: #3a3a4a; 
    border-color: #4a4a5a; 
}

.admin-record-left { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-wrap: wrap; 
    flex: 1; 
    font-size: 0.85rem; 
}

.admin-record-checkbox { 
    margin-right: 4px; 
}

.admin-record-actions { 
    display: flex; 
    gap: 6px; 
    flex-shrink: 0; 
}

.admin-record-actions button { 
    padding: 4px 10px; 
    font-size: 0.7rem; 
    width: auto; 
    border-radius: 10px; 
}

/* Sticky top */
.sticky-top { 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: inherit; 
}

.sticky-top .card:first-child { 
    margin-bottom: 0; 
    border-bottom-left-radius: 0; 
    border-bottom-right-radius: 0; 
}

.sticky-top .card:last-child { 
    margin-top: 0; 
    border-top-left-radius: 0; 
    border-top-right-radius: 0; 
}

/* Scrollable containers */
.scrollable-container { 
    max-height: 500px; 
    overflow-y: auto; 
    border-radius: 16px; 
}

.scrollable-audit { 
    max-height: 300px; 
    overflow-y: auto; 
}

/* Password wrapper */
.password-wrapper { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
}

.password-wrapper input { 
    flex: 1; 
}

.toggle-pwd { 
    width: auto; 
    padding: 10px; 
    background: #9ca3af; 
}

/* Popup overlay */
.popup-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    z-index: 2000; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.popup-content { 
    background: white; 
    padding: 24px; 
    border-radius: 30px; 
    max-width: 500px; 
    width: 90%; 
    max-height: 80vh; 
    overflow-y: auto; 
}

.popup-content h3 { 
    margin-top: 0; 
}

/* Emergency icon */
.emergency-icon { 
    color: #ef4444; 
    font-weight: bold; 
}

/* Logout button */
.logout-btn:hover { 
    background: #dc2626 !important; 
}

.emergency-header-btn:hover { 
    background: #d97706 !important; 
}

/* Audit log device ID */
.device-id { 
    font-size: 0.7rem; 
    color: #64748b; 
    display: inline-block; 
    margin-top: 2px; 
}

/* Progress bar */
.progress-bar { 
    background: #e2e8f0; 
    border-radius: 20px; 
    height: 6px; 
    overflow: hidden; 
    margin: 6px 0; 
}

.progress-fill { 
    background: #10b981; 
    height: 100%; 
    width: 0%; 
    transition: width 0.3s; 
}

/* Attendance status badge */
.attended-badge { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 20px; 
    font-size: 0.65rem; 
    font-weight: 600; 
    margin-left: 6px; 
}

.attended-yes { 
    background: #d1fae5; 
    color: #065f46; 
}

.attended-fail { 
    background: #fee2e2; 
    color: #991b1b; 
}

body.dark .attended-yes { 
    background: #064e3b; 
    color: #34d399; 
}

body.dark .attended-fail { 
    background: #7f1d1d; 
    color: #f87171; 
}

/* Responsive untuk login page */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        border-radius: 24px;
    }
    
    .login-hero {
        padding: 32px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        gap: 16px;
    }
    
    .login-form {
        padding: 32px;
    }
}

/* Mobile specific */
@media (max-width: 700px) { 
    .flex-row { 
        flex-direction: column; 
        align-items: stretch; 
    } 
    .sticky-top .card:last-child > div { 
        flex-direction: row; 
        flex-wrap: wrap; 
    }
    .sticky-top .card:last-child button { 
        flex: 1; 
        font-size: 0.7rem; 
        padding: 8px 4px; 
        white-space: nowrap; 
    }
    .admin-record-left { 
        flex-wrap: wrap; 
        gap: 4px; 
    }
}

/* Role cards di popup login */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.3rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
}

.modal-body {
    padding: 24px;
}

.role-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.role-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.role-info {
    flex: 2;
}

.role-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0f172a;
}

.role-info p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}

.role-input {
    flex: 2;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-input-sm,
.form-select-sm {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 100px;
}

.btn-role {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.btn-role:hover {
    background: #2563eb;
}

@media (max-width: 600px) {
    .role-card {
        flex-direction: column;
        text-align: center;
    }
    .role-input {
        width: 100%;
    }
}