/* ==========================================
            OFFICEPULSE DESIGN TOKENS
========================================== */

:root {
    --primary: #6366F1;
    --primary-light: #818CF8;

    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* THEME SYSTEM TOKENS (DEFAULT DARK) */
    --bg-mesh: linear-gradient(135deg, #0F172A, #111827, #1E293B);
    --surface-sidebar: rgba(255, 255, 255, 0.05);
    --surface-card: rgba(255, 255, 255, 0.06);
    --surface-input: rgba(255, 255, 255, 0.06);
    --surface-input-focus: rgba(255, 255, 255, 0.08);
    --surface-table-head: rgba(255, 255, 255, 0.06);
    --surface-table-row-hover: rgba(255, 255, 255, 0.04);
    --surface-tracker: rgba(255, 255, 255, 0.04);
    --surface-detail-box: rgba(255, 255, 255, 0.04);

    --text: #F8FAFC;
    --text-light: #CBD5E1;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.25);

    --white: #ffffff;
    --radius: 20px;
    --transition: .35s ease;
}

/* ==========================================
          LIGHT THEME DYNAMIC OVERRIDES
========================================== */

body.light-theme {
    --bg-mesh: linear-gradient(135deg, #F1F5F9, #E2E8F0, #CBD5E1);
    --surface-sidebar: rgba(15, 23, 42, 0.04);
    --surface-card: rgba(255, 255, 255, 0.95);
    --surface-input: rgba(15, 23, 42, 0.05);
    --surface-input-focus: rgba(255, 255, 255, 1);
    --surface-table-head: rgba(15, 23, 42, 0.05);
    --surface-table-row-hover: rgba(15, 23, 42, 0.03);
    --surface-tracker: rgba(15, 23, 42, 0.03);
    --surface-detail-box: rgba(15, 23, 42, 0.03);

    --text: #0F172A;
    --text-light: #475569;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* ==========================================
                RESET
========================================== */

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-mesh);
    background-size: 300% 300%;
    animation: gradientMove 12s ease infinite;
    color: var(--text);
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* ==========================================
            SCROLLBAR
========================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 20px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

/* ==========================================
            WRAPPER
========================================== */

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
            SIDEBAR
========================================== */

.sidebar {
    width: 270px;
    background: var(--surface-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 30px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
}

.logo i {
    font-size: 34px;
    color: var(--primary);
}

.logo h2 {
    font-size: 28px;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 12px;
}

.sidebar-menu li a {
    text-decoration: none;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    border-radius: 14px;
    transition: var(--transition);
}

.sidebar-menu li a:hover {
    background: rgba(99, 102, 241, .18);
    color: var(--text);
    transform: translateX(8px);
}

.sidebar-menu .active a {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

/* ==========================================
            MAIN CONTENT
========================================== */

.main-content {
    margin-left: 270px;
    width: 100%;
    padding: 35px;
    transition: var(--transition);
}

/* ==========================================
            TOP NAVBAR
========================================== */

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.page-title {
    font-size: 34px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-light);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-card);
    color: var(--text);
    transition: var(--transition);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px) rotate(8deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 30px;
    background: var(--surface-card);
    border: 1px solid var(--border);
}

.user-profile i {
    font-size: 28px;
}

/* ==========================================
            WELCOME BANNER
========================================== */

.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 35px;
    margin-bottom: 35px;
    border-radius: var(--radius);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

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

.welcome-banner p {
    color: var(--text-light);
    margin: 0;
}

.welcome-banner .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-light)
    );
    font-weight: 600;
    transition: var(--transition);
}

.welcome-banner .btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, .35);
}

/* ==========================================
            DASHBOARD GRID
========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

/* ==========================================
            DASHBOARD CARD
========================================== */

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, .08),
        transparent
    );
    transition: .7s;
}

.dashboard-card:hover::before {
    left: 100%;
}

.dashboard-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    color: #fff;
    flex-shrink: 0;
}

.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.green { background: linear-gradient(135deg, #22C55E, #16A34A); }
.orange { background: linear-gradient(135deg, #F59E0B, #D97706); }
.purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }

.card-content {
    flex: 1;
}

.card-content h6 {
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 500;
}

.card-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-content small {
    color: var(--text-light);
}

/* ==========================================
            CONTENT GRID
========================================== */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
    margin-bottom: 35px;
}

/* ==========================================
            SECTION TITLE
========================================== */

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.section-title h3 {
    font-size: 24px;
    font-weight: 600;
}

/* ==========================================
            COMMON CARDS
========================================== */

.progress-card,
.entry-card,
.records-table-card,
.summary-card,
.chart-card,
.calendar-card {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.progress-card:hover,
.entry-card:hover,
.records-table-card:hover,
.summary-card:hover,
.chart-card:hover,
.calendar-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================
            BUTTONS
========================================== */

.btn {
    transition: var(--transition);
}

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

.btn:active {
    transform: scale(0.97);
}

/* ==========================================
            PROGRESS RING
========================================== */

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 14;
}

.progress-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 1s ease;
}

.progress-text {
    position: absolute;
    text-align: center;
}

.progress-text h2 {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 5px;
}

.progress-text span {
    color: var(--text-light);
    font-size: 14px;
}

.progress-details {
    width: 100%;
    margin-top: 25px;
    display: grid;
    gap: 15px;
}

.detail-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--surface-detail-box);
    border: 1px solid var(--border);
}

.detail-box small {
    color: var(--text-light);
}

.detail-box h5 {
    margin: 0;
    font-weight: 600;
}

/* ==========================================
            ENTRY FORM
========================================== */

.entry-card form {
    margin-top: 10px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.form-control,
.form-select {
    background: var(--surface-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:focus,
.form-select:focus {
    background: var(--surface-input-focus);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 .25rem rgba(99, 102, 241, .25);
}

textarea.form-control {
    resize: none;
}

/* ==========================================
      DROPDOWN OPTIONS TEXT COLOR FIX
========================================== */

.form-select option {
    color: #0F172A !important;
    background-color: #FFFFFF !important;
}

body.light-theme .form-select option {
    color: #0F172A !important;
    background-color: #FFFFFF !important;
}

/* ==========================================
            LIVE TRACKER
========================================== */

.live-tracker {
    margin-top: 30px;
    padding: 20px;
    border-radius: 16px;
    background: var(--surface-tracker);
    border: 1px solid var(--border);
}

.live-tracker h5 {
    margin-bottom: 18px;
    font-weight: 600;
}

.tracker-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.tracker-buttons .btn {
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
}

.btn-success:hover {
    box-shadow: 0 10px 25px rgba(34, 197, 94, .35);
}

.btn-warning:hover {
    box-shadow: 0 10px 25px rgba(245, 158, 11, .35);
}

.btn-info:hover {
    box-shadow: 0 10px 25px rgba(6, 182, 212, .35);
}

.btn-danger:hover {
    box-shadow: 0 10px 25px rgba(239, 68, 68, .35);
}

/* ==========================================
            FORM ACTIONS
========================================== */

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.form-actions .btn {
    min-width: 160px;
    padding: 12px 20px;
    border-radius: 12px;
}

/* ==========================================
            BADGES
========================================== */

.badge {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
            RECORDS SECTION
========================================== */

.records-section {
    margin-bottom: 35px;
}

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

.records-header p {
    color: var(--text-light);
    margin-top: 5px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.records-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    padding-left: 45px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filters .form-select {
    min-width: 170px;
}

/* ==========================================
                TABLE
========================================== */

.records-table-card {
    overflow: hidden;
}

.table {
    color: var(--text);
    margin: 0;
    width: 100%;
}

.table thead {
    background: var(--surface-table-head);
}

.table thead th {
    border: none;
    padding: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.table tbody td {
    padding: 18px;
    border-color: var(--border);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
    background: transparent;
}

.table tbody tr:hover {
    background: var(--surface-table-row-hover);
}

.status-badge {
    padding: 7px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}

.status-success {
    background: rgba(34, 197, 94, .18);
    color: #22C55E;
}

.status-warning {
    background: rgba(245, 158, 11, .18);
    color: #F59E0B;
}

.status-danger {
    background: rgba(239, 68, 68, .18);
    color: #EF4444;
}

/* ==========================================
            EMPTY STATE
========================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 20px;
}

.empty-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--surface-card);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.empty-icon i {
    font-size: 42px;
    color: var(--primary);
}

.empty-state h4 {
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    max-width: 450px;
}

/* ==========================================
            CALENDAR
========================================== */

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

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 15px;
    background: var(--surface-table-row-hover);
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
}

/* ==========================================
            SUMMARY
========================================== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 35px 0;
}

.summary-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface-tracker);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
}

.summary-item:hover {
    background: var(--surface-table-row-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.summary-item span {
    color: var(--text-light);
    font-weight: 500;
}

.summary-item strong {
    font-size: 16px;
    font-weight: 600;
}

/* ==========================================
            CHARTS
========================================== */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

.chart-card canvas {
    margin-top: 20px;
    max-height: 250px !important;
    width: 100% !important;
}

/* ==========================================
            FLOATING BUTTON
========================================== */

.fab {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 65px;
    height: 65px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-light)
    );
    color: white;
    font-size: 26px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ==========================================
            FOOTER
========================================== */

.footer {
    margin-top: 40px;
    padding: 25px;
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

/* ==========================================
            LOADING
========================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ==========================================
            RESPONSIVE
========================================== */

@media(max-width:1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:992px) {
    .sidebar {
        left: -270px;
    }
    .main-content {
        margin-left: 0;
    }
}

@media(max-width:768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .welcome-banner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .records-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filters {
        width: 100%;
        flex-direction: column;
    }
    .tracker-buttons {
        grid-template-columns: 1fr;
    }
}

@media(max-width:576px) {
    .main-content {
        padding: 18px;
    }
    .page-title {
        font-size: 28px;
    }
    .welcome-banner h2 {
        font-size: 24px;
    }
    .fab {
        width: 58px;
        height: 58px;
        right: 20px;
        bottom: 20px;
    }
}