:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #24344d;
    --bg-input: #0b1329;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --radius: 10px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 1.8rem;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #60a5fa;
    display: block;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #fff;
    background-color: var(--primary);
}

.nav-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-meta {
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.user-badge {
    font-size: 0.72rem;
    background-color: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

/* CONTAINER */
.container {
    max-width: 1280px;
    margin: 24px auto;
    padding: 0 16px;
}

/* AUTH SECTION */
.auth-card {
    max-width: 420px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
}

.auth-header h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.kpi-title {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.text-blue { color: #60a5fa; }
.text-green { color: #34d399; }
.text-emerald { color: #10b981; }
.text-purple { color: #c084fc; }

/* FILTER BAR */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.flex-grow {
    flex-grow: 1;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.code-textarea {
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.separator {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

/* BUTTONS */
.btn {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-tab {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    margin-right: 8px;
}

.btn-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ALERTS */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

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

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

/* CARDS & REQUESTS GRID */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.requests-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.request-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.request-card:hover {
    background: var(--bg-card-hover);
    border-color: #475569;
}

.req-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.req-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.req-number {
    font-family: monospace;
    font-weight: 800;
    color: #60a5fa;
    font-size: 1.05rem;
}

.req-title {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.req-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.req-meta-item strong {
    color: #cbd5e1;
}

.req-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 20px;
}

.req-progress-box {
    width: 170px;
}

.progress-text {
    font-size: 0.78rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-weight: 600;
}

.progress-bar-bg {
    background: #0f172a;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    transition: width 0.3s ease;
}

/* BADGES */
.badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid var(--warning);
}

.badge-in_progress {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid var(--primary);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid var(--success);
}

.badge-cancelled {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid #64748b;
}

.badge-priority-critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid var(--danger);
}

.badge-priority-urgent {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-priority-normal {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.badge-info {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
    border: 1px solid var(--info);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

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

.table-sm th, .table-sm td {
    padding: 8px 10px;
    font-size: 0.82rem;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-lg {
    max-width: 850px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    color: #fff;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.notes-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.notes-box p {
    margin-top: 4px;
    color: #cbd5e1;
}

.progress-section {
    margin-bottom: 20px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* PHOTOS GALLERY */
.photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.photo-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    text-align: center;
}

.photo-card:hover {
    transform: translateY(-2px);
    border-color: #60a5fa;
}

.photo-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.photo-meta {
    padding: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.photo-pkg-code {
    font-weight: 700;
    color: #6ee7b7;
    font-family: monospace;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-photos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* LIGHTBOX */
.lightbox-dialog {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: -36px;
    right: 0;
    font-size: 1.8rem;
    color: #fff;
}

.lightbox-content {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
}

.lightbox-meta {
    padding: 12px 16px;
    width: 100%;
    background: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.lightbox-title {
    font-weight: bold;
    color: #60a5fa;
    font-family: monospace;
}

.lightbox-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

.admin-tabs-bar {
    display: flex;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-header h3 {
    font-size: 1.2rem;
    color: #fff;
}

.section-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
}
