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

:root {
    --petroleum: #1a5e63;
    --burgundy: #6b113a;
    --gold: #d4a017;
    --text-main: #333333;
    --bg-page: #f5f7fa;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

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

body { background-color: var(--bg-page); color: var(--text-main); font-size: 16px; line-height: 1.6; }
.dashboard-bg { background-color: var(--bg-page); }
.font-number { font-family: 'Courier New', Courier, monospace; font-weight: bold; letter-spacing: 1px;}
.font-bold { font-weight: 700; }

.container { max-width: 1300px; margin: 0 auto; padding: 0 15px; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #64748b; }
.text-white { color: var(--white); }
.text-dark { color: #1e293b; }
.text-burgundy { color: var(--burgundy); }
.gap-10 { gap: 10px; }
.flex-1 { flex: 1; }

.bg-petroleum { background-color: var(--petroleum); color: var(--white); }
.bg-burgundy { background-color: var(--burgundy); color: var(--white); }
.bg-gold { background-color: var(--gold); color: #000; }
.border-bottom { border-bottom: 1px solid var(--border-color); }

/* --- Login Page (Solid & Beautiful Clock Design) --- */
.login-body {
    display: flex; justify-content: center; align-items: center; min-height: 100vh;
    background: #0f172a; position: relative; overflow: hidden;
}
.login-container { position: relative; width: 420px; height: 420px; display: flex; justify-content: center; align-items: center; }

.bg-bubbles { position: absolute; inset:0; pointer-events: none; }
.bubble { position: absolute; background: rgba(255, 255, 255, 0.03); border-radius: 50%; animation: floatUp linear infinite; }
@keyframes floatUp { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-120vh); opacity: 0; } }

.clock-outer-container { position: relative; width: 450px; height: 450px; display: flex; justify-content: center; align-items: center; z-index: 10; }
.clock-minute-marks {
    position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1);
    -webkit-mask: repeating-conic-gradient(black 0deg 1deg, transparent 1deg 6deg);
    mask: repeating-conic-gradient(black 0deg 1deg, transparent 1deg 6deg);
}
.glowing-seconds-hand {
    position: absolute; inset: -4px; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 70%, var(--petroleum) 95%, var(--gold) 100%);
    animation: rotate 4s linear infinite; box-shadow: 0 0 15px rgba(212, 160, 23, 0.4);
    -webkit-mask: radial-gradient(circle at center, transparent 66%, black 67%);
    mask: radial-gradient(circle at center, transparent 66%, black 67%);
}
@keyframes rotate { 100% { transform: rotate(360deg); } }

.login-box-glass {
    position: relative; width: 85%; height: 85%; background: var(--white);
    border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 10;
}
.login-logo { width: 80px; height: auto; margin-bottom: 5px; object-fit: contain; border-radius: 8px; }
.brand-title { color: var(--petroleum); font-size: 2rem; font-weight: 700; margin: 0; }
.brand-subtitle { color: var(--muted-text); font-size: 0.9rem; margin: 5px 0 0 0; text-align: center; }

.login-box-glass form { width: 80%; }
.login-box-glass .form-group { margin-bottom: 12px; }
.login-box-glass .form-control { border-radius: 20px; text-align: center; }

/* --- Navbar --- */
.navbar { background: var(--white); padding: 12px 0; border-bottom: 3px solid var(--petroleum); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.nav-container { max-width: 1300px; margin: 0 auto; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;}
.brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { height: 40px; object-fit: contain; }
.brand h2 { color: var(--petroleum); font-size: 1.4rem; margin: 0; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.user-badge { font-weight: bold; color: var(--petroleum); background: #e2e8f0; padding: 6px 12px; border-radius: 5px; }

/* --- Cards --- */
.card { background: var(--white); border-radius: 8px; border: 1px solid var(--border-color); padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.panel-title { font-size: 1.2rem; color: var(--petroleum); font-weight: bold; margin-bottom: 15px; }
.panel-primary { border-top: 4px solid var(--petroleum); }
.panel-secondary { border-top: 4px solid var(--burgundy); }

/* --- Forms --- */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; align-items: end; }
.full-width { grid-column: 1 / -1; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; color: #475569; font-size: 0.9rem; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 1rem; color: #1e293b; transition: 0.2s; }
.form-control:focus { border-color: var(--petroleum); outline: none; box-shadow: 0 0 0 2px rgba(26, 94, 99, 0.1); }

/* --- Buttons --- */
.btn { display: inline-block; padding: 10px 15px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; text-decoration: none; text-align: center; transition: 0.2s; font-size: 0.95rem; }
.btn-primary { background: var(--petroleum); color: var(--white); }
.btn-primary:hover { background: #13464a; }
.btn-secondary { background: #e2e8f0; color: #333; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success { background: #10b981; color: var(--white); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--burgundy); color: var(--white); }
.btn-danger:hover { background: #4f0c2a; }
.btn-warning { background: var(--gold); color: #000; }
.btn-warning:hover { background: #b88a12; }
.btn-outline { border: 1px solid var(--border-color); background: transparent; color: var(--text-main); }
.btn-outline:hover { border-color: var(--petroleum); color: var(--petroleum); }
.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-large { padding: 12px 20px; font-size: 1.05rem; }

/* --- Stats Grid --- */
.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.stat-card { background: var(--white); border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.03); }
.border-petroleum { border: 1px solid var(--petroleum); }
.border-burgundy { border: 1px solid var(--burgundy); }
.border-gold { border: 1px solid var(--gold); }
.stat-header { padding: 12px 15px; font-weight: bold; font-size: 1.1rem; text-align: center; }
.stat-body { padding: 15px; }
.stat-row { display: flex; justify-content: space-between; font-size: 1.15rem; padding: 4px 0; border-bottom: 1px dashed #e2e8f0; }
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: #64748b; font-weight: bold; font-size: 1rem; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; border-radius: 5px; border: 1px solid var(--border-color); }
.table { width: 100%; border-collapse: collapse; background: var(--white); min-width: 800px; }
.table th, .table td { padding: 12px 15px; text-align: right; border-bottom: 1px solid var(--border-color); }
.table th { background: #f8fafc; font-weight: bold; color: var(--petroleum); font-size: 0.95rem; }
.table tbody tr:hover { background: #f1f5f9; }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; display: inline-block; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin-top:25px; }
.page-link { padding: 6px 12px; border: 1px solid var(--border-color); background: var(--white); color: var(--text-main); font-weight: bold; border-radius: 4px; text-decoration: none; }
.page-link:hover, .page-link.active { background: var(--petroleum); color: var(--white); border-color: var(--petroleum); }

/* Layout Grid Admin */
.admin-grid { display: grid; grid-template-columns: 1fr 350px; gap: 20px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-main { width: 100%; }
.admin-side { width: 100%; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
    .nav-actions { width: 100%; justify-content: space-between; margin-top: 10px; }
    .table th, .table td { padding: 10px 8px; font-size: 0.85rem; }
    .stat-row { font-size: 1rem; }
    .grid-form { grid-template-columns: 1fr; gap: 12px; }
    .clock-outer-container { width: 95vw; height: 95vw; max-width: 400px; max-height: 400px; }
}

footer { text-align: center; padding: 20px; margin-top: 40px; border-top: 1px solid var(--border-color); font-size: 0.9rem; color: #64748b; }
