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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --success: #10b981;
    --success-hover: #059669;
    --success-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --warning: #f59e0b;
    --info: #06b6d4;
    --danger: #ef4444;
    --danger-hover: #dc2626;

    /* LIGHT MODE (Default) */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.08);
    --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --input-bg: #ffffff;
    --input-text: #0f172a;
    --input-border: #cbd5e1;

    --radial-1: rgba(99, 102, 241, 0.05);
    --radial-2: rgba(16, 185, 129, 0.05);
    --radial-3: rgba(245, 158, 11, 0.03);
    --grid-color: rgba(15, 23, 42, 0.004);
}

[data-theme="dark"] {
    /* DARK MODE */
    --bg-main: #080c14;
    --bg-card: rgba(17, 24, 39, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-main: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --navbar-bg: rgba(15, 23, 42, 0.75);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-text: #ffffff;
    --input-border: rgba(255, 255, 255, 0.1);

    --radial-1: rgba(99, 102, 241, 0.18);
    --radial-2: rgba(16, 185, 129, 0.15);
    --radial-3: rgba(79, 70, 229, 0.12);
    --grid-color: rgba(255, 255, 255, 0.007);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Base Body Style with Mesh Gradients & Grid */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
    background-image:
        radial-gradient(at 0% 0%, var(--radial-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--radial-2) 0px, transparent 50%),
        radial-gradient(at 50% 100%, var(--radial-3) 0px, transparent 50%),
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 30px 30px, 30px 30px;
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease, background-image 0.3s ease;
}

body.dashboard-body {
    display: block;
    min-height: 100vh;
}

/* Authentication Page Body */
body.auth-page {
    /* Uses base body properties but forces auth styles */
}

/* Cards (Translucent Glassmorphism Panels) */
.card,
.dashboard-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    width: 100%;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.card {
    max-width: 450px;
    padding: 40px 30px;
}

.card.login-card {
    max-width: 400px;
}

.dashboard-card {
    padding: 30px;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h3,
.dashboard-card h3 {
    color: var(--text-main);
    font-weight: 700;
    transition: color 0.3s ease;
}

.card-header h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.dashboard-card h3 {
    margin-bottom: 24px;
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    transition: border-color 0.3s ease;
}

.card-header p {
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s ease;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13.5px;
    transition: color 0.3s ease;
}

.form-group input,
.form-group select,
textarea.form-control,
select.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: all 0.3s ease;
}

.form-group input::placeholder,
textarea.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-group input:focus,
.form-group select:focus,
textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    outline: none;
}

.form-group select option {
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* Login input green highlight focus */
.input-green:focus {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

/* Buttons */
.btn-submit {
    width: 100%;
    padding: 12.5px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit:hover {
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-blue {
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-blue:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.btn-green {
    background: var(--success-gradient);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-green:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
}

/* Floating & Navbar Theme Toggle Buttons */
.theme-btn-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-main);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-btn-floating:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.theme-btn-navbar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.theme-btn-navbar:hover {
    transform: translateY(-0.5px);
    border-color: var(--primary);
}

/* Alerts */
.alert {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid #fecaca;
}

.text-center {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
}

.text-center p {
    color: var(--text-muted);
}

.text-center a {
    text-decoration: none;
    font-weight: 600;
}

.link-blue {
    color: var(--primary);
}

.link-blue:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.link-green {
    color: var(--success);
}

.link-green:hover {
    color: var(--success-hover);
    text-decoration: underline;
}

/* --- DASHBOARD COMPONENTS --- */
.navbar {
    background-color: var(--navbar-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 70px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.navbar .brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.btn-logout {
    color: white;
    text-decoration: none;
    background-color: var(--danger);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: var(--danger-hover);
    transform: translateY(-0.5px);
}

.container {
    max-width: 1200px;
    margin: 100px auto 40px auto;
    /* navbar height offset */
    padding: 0 24px;
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .dashboard-grid.dual-col {
        grid-template-columns: 1.2fr 1.8fr;
    }
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Stats Widgets Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-main);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-info h4 {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.stat-card-info p {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    transition: color 0.3s ease;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-blue {
    background-color: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.icon-yellow {
    background-color: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.icon-cyan {
    background-color: rgba(6, 182, 212, 0.12);
    color: var(--info);
}

.icon-green {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

/* Table styling */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

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

table th {
    background-color: var(--navbar-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    transition: all 0.3s ease;
}

table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
    transition: color 0.3s ease, border-color 0.3s ease;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: rgba(120, 120, 120, 0.04);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.badge-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-process {
    background-color: #ecfeff;
    color: #0891b2;
}

.badge-success {
    background-color: #d1fae5;
    color: #059669;
}

.badge-category {
    background-color: var(--input-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background-color: var(--input-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
}

.category-item span {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.category-item:hover {
    transform: translateX(3px);
    border-color: var(--primary);
}

body.dashboard-body hr {
    border-top: 1px solid var(--border-color) !important;
}

.img-preview {
    max-width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
    cursor: pointer;
}

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

.img-large {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ========== WELCOME BANNER ========== */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 24px 30px;
    margin-bottom: 28px;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
    flex-wrap: wrap;
    gap: 12px;
}

.welcome-banner h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-banner p {
    font-size: 13.5px;
    opacity: 0.85;
}

.welcome-date {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    text-align: right;
    white-space: nowrap;
}

/* ========== NAV LINK PILLS (Navbar) ========== */
.nav-link-pill {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-link-pill:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.nav-link-pill.active {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.25);
}

/* ========== CATEGORY PROGRESS BARS ========== */
.cat-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.cat-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
}

.cat-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cat-bar-count {
    font-size: 12px;
    font-weight: 700;
}

.cat-bar-track {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-bar-pct {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
}

/* ========== ICON PURPLE ========== */
.icon-purple {
    background-color: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

/* ========== CRUD ACTION BUTTONS ========== */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-edit {
    background-color: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-edit:hover {
    background-color: rgba(245, 158, 11, 0.2);
}

.btn-delete {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.btn-view {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.btn-view:hover {
    background-color: rgba(99, 102, 241, 0.2);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-box {
    transform: translateY(0);
}

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

.modal-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--text-main);
}

/* Search / Filter bar */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 13.5px;
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid #a7f3d0;
}