@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0077b6;
    --primary-hover: #023e8a;
    --secondary: #00b4d8;
    --dark: #03045e;
    --dark-card: rgba(2, 62, 138, 0.4);
    --text-main: #f8fafc;
    --text-muted: #caf0f8;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --body-bg: #03045e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--body-bg);
    background-image: radial-gradient(circle at top right, rgba(0, 180, 216, 0.15), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(0, 119, 182, 0.15), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Install & Login Centered Body */
.install-body, .login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.install-container, .login-container {
    width: 100%;
    max-width: 500px;
}

h2 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-align: center;
}

.section-title {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.3);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

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

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

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard Layout */
.navbar {
    background: var(--dark-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 769px) {
    .mobile-header {
        width: auto;
    }
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-left: 2rem;
}

.nav-toggle, .nav-toggle-label {
    display: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-badge {
    background: rgba(0, 119, 182, 0.3);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.main-content {
    padding: 2rem;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.voucher-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.voucher-img:hover {
    transform: scale(1.1);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .navbar {
        display: block;
        padding: 1rem;
    }
    
    .mobile-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-toggle-label {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        color: var(--text-main);
        padding: 0.5rem;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--glass-border);
    }
    
    #nav-toggle:checked ~ .nav-menu {
        display: flex !important;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        text-align: center;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-actions h2 {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .header-actions .d-flex {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
    }
    
    .d-flex.gap-3 > div {
        max-width: 100% !important;
        width: 100%;
    }
    
    .glass-panel {
        padding: 1.5rem 1rem;
    }
    
    /* Data Tables on Mobile */
    .table-container {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Report Form overrides */
    form.d-flex.align-center {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    form.d-flex.align-center .form-group {
        width: 100%;
    }
    
    form.d-flex.align-center .btn {
        width: 100%;
        margin-top: 1rem;
    }
}
