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

:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-soft: #ede9fe;
    --primary-dark: #5b21b6;
    --primary-gradient: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 48%, #c4b5fd 100%);
    --secondary: #8b5cf6;
    --accent: #c084fc;
    --accent-success: #16a34a;
    --accent-warning: #d97706;
    --accent-error: #dc2626;
    --accent-info: #6d28d9;
    --accent-danger: #dc2626;
    --bg-main: #f5f3ff;
    --bg-card: #ffffff;
    --bg-darker: #f4f4f8;
    --bg-deep: rgba(255, 255, 255, 0.84);
    --text-main: #312e43;
    --text-muted: #756f86;
    --text-heading: #201a37;
    --border-glass: rgba(109, 40, 217, 0.12);
    --surface-glass: rgba(255, 255, 255, 0.82);
    --surface-glass-hover: rgba(255, 255, 255, 0.96);
    --surface-panel: rgba(246, 243, 255, 0.92);
    --shadow-soft: 0 20px 45px -32px rgba(65, 45, 120, 0.35);
    --shadow-card: 0 32px 70px -42px rgba(76, 29, 149, 0.24);
    --shadow-glow: 0 18px 36px -24px rgba(139, 92, 246, 0.45);
    --card-padding: 1.6rem;
    --transition-smooth: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    --sidebar-width: 260px;
    --header-height: 70px;
    --card-radius: 1.5rem;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.16) 0%, transparent 34%),
        radial-gradient(circle at 85% 12%, rgba(196, 181, 253, 0.9) 0%, transparent 28%),
        linear-gradient(180deg, #fcfbff 0%, #f5f3ff 52%, #f6f6fb 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 18%, rgba(109, 40, 217, 0.08), transparent 26%),
        radial-gradient(circle at 88% 82%, rgba(167, 139, 250, 0.16), transparent 22%);
    opacity: 0.95;
    z-index: -1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.flash-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    width: min(320px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.9rem;
    padding: 1.05rem 1.05rem 1.2rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(109, 40, 217, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 255, 0.94));
    box-shadow: 0 24px 46px -28px rgba(32, 26, 55, 0.3);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.45;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 28px 54px -30px rgba(32, 26, 55, 0.34);
}

.alert-success {
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.alert--closing {
    opacity: 0 !important;
    transform: translateY(-8px) scale(0.98);
}

.alert__accent {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.95), rgba(167, 139, 250, 0.6));
}

.alert-danger .alert__accent {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.95), rgba(251, 146, 60, 0.55));
}

.alert-success .alert__accent {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.95), rgba(34, 197, 94, 0.55));
}

.alert__icon {
    width: 38px;
    height: 38px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-dark);
    font-weight: 900;
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.12);
}

.alert-danger .alert__icon {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.12);
}

.alert-success .alert__icon {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.alert__content {
    display: grid;
    gap: 0.18rem;
    padding-right: 0.5rem;
}

.alert__eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.alert__message {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 300;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 800;
    border: 1px solid rgba(124, 58, 237, 0.18);
    box-shadow: var(--shadow-soft);
    transform: translateY(-140%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.flash-close {
    margin-left: 0.25rem;
    border: none;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.08);
}

.flash-close:hover {
    opacity: 0.92;
    color: var(--primary-dark);
    transform: rotate(90deg);
}

.alert__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    transform-origin: left center;
    animation: flashProgress 5.2s linear forwards;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.95), rgba(196, 181, 253, 0.88));
}

.alert-danger .alert__progress {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(251, 146, 60, 0.88));
}

.alert-success .alert__progress {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.95), rgba(74, 222, 128, 0.88));
}

@keyframes flashProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.28);
    outline-offset: 2px;
}

button:disabled,
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

form.is-submitting {
    pointer-events: none;
}

button.is-submitting::after,
.btn.is-submitting::after {
    content: " ...";
}

.mobile-topbar,
.sidebar-overlay {
    display: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 247, 255, 0.92) 100%);
    backdrop-filter: blur(26px);
    border-right: 1px solid rgba(109, 40, 217, 0.1);
    display: flex;
    flex-direction: column;
    padding: 1.6rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 22px 0 50px -44px rgba(76, 29, 149, 0.42);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.1);
    border-radius: 10px;
}

.sidebar-brand {
    margin-bottom: 1.2rem;
}

.sidebar-brand span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.sidebar h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 1.4rem;
    letter-spacing: -0.035em;
    padding: 0.65rem 0.9rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(196, 181, 253, 0.18));
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
    padding: 0.95rem 1rem;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(124, 58, 237, 0.14);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 16px 36px -28px rgba(76, 29, 149, 0.55);
}

.sidebar-user-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px -30px rgba(76, 29, 149, 0.6);
}

.sidebar-user-card__avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
}

.sidebar-user-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-card__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-user-card__content strong {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.25;
}

.sidebar-user-card__content span {
    color: var(--text-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar ul {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar li {
    margin-bottom: 0;
}

.sidebar a {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    gap: 0.9rem;
    white-space: nowrap;
    border: 1px solid transparent;
}

.sidebar a i {
    width: 20px;
    height: 20px;
}

.sidebar a[href="/logout"] {
    margin-top: 1rem;
    background: rgba(254, 242, 242, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.12);
}

.sidebar a[href="/logout"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: translateY(-2px);
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-main);
    transform: translateX(4px);
    border-color: rgba(109, 40, 217, 0.14);
    box-shadow: 0 14px 24px -20px rgba(109, 40, 217, 0.3);
}

.btn-action {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #ffffff !important;
    border: 1px solid rgba(124, 58, 237, 0.2) !important;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-action i {
    width: 16px;
    height: 16px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
    border-color: var(--primary-light) !important;
    color: var(--primary);
}

.btn-action.btn-approve:hover { color: #10b981; border-color: #10b981 !important; background: rgba(16, 185, 129, 0.05) !important; }
.btn-action.btn-reject:hover { color: #ef4444; border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.05) !important; }
.btn-action.btn-delete:hover { color: #ef4444; border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.05) !important; }

.sidebar a.active {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.96), rgba(139, 92, 246, 0.92));
    color: white;
    box-shadow: 0 22px 34px -24px rgba(109, 40, 217, 0.78);
    border-color: transparent;
}

.sidebar a[href="/logout"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger) !important;
}

/* Content Area */
.content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 2.5rem 2.5rem 3rem;
    animation: fadeIn 0.8s ease-out;
    background: transparent;
    overflow-x: hidden;
}

.content > * {
    min-width: 0;
    max-width: 100%;
}

.page-container {
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

.employee-folder summary::-webkit-details-marker {
    display: none;
}

.employee-folder__summary {
    user-select: none;
}

.employee-folder[open] .employee-folder__summary {
    border-bottom-color: var(--border-glass) !important;
}

.employee-folder[open] .folder-chevron {
    transform: rotate(180deg);
}

/* Header/Welcome Section */
.page-header {
    margin-bottom: 2.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* Events page grid: create form + records list */
.events-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 900px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
}

.page-header h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-heading);
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.widget, .card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(249, 246, 255, 0.92) 100%);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(109, 40, 217, 0.1);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.widget,
.card,
.table-responsive,
form,
input,
select,
textarea,
canvas,
img {
    max-width: 100%;
}

.card-header {
    padding: 1.35rem 1.6rem;
    border-bottom: 1px solid rgba(109, 40, 217, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(247, 243, 255, 0.96), rgba(255, 255, 255, 0.82));
    gap: 1.5rem;
    min-height: 70px;
    flex-wrap: wrap;
    min-width: 0;
}

.card-header h3, .card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: normal;
    text-transform: none;
    letter-spacing: -0.01em;
}

.card-header .label-upper {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.widget::before, .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(109, 40, 217, 0.04), transparent 52%);
    opacity: 1;
    transition: var(--transition-smooth);
    z-index: 0;
}

.widget:hover, .card:hover {
    transform: translateY(-4px);
    border-color: rgba(109, 40, 217, 0.16);
    box-shadow: 0 32px 56px -38px rgba(76, 29, 149, 0.32);
}

.widget * , .card * {
    position: relative;
    z-index: 1;
}

.widget h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 800;
}

.widget-big-text {
    font-size: clamp(2.4rem, 3vw, 3.35rem);
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    line-height: 1;
}

/* Tables */
.table-responsive {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-radius: var(--card-radius);
    border: 1px solid rgba(109, 40, 217, 0.1);
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    margin-top: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
    min-width: 0;
}

/* Ensure tables inside .table-responsive truly adapt on small screens
   - Force width:100% and allow cells to wrap on narrow viewports
   - Keep nowrap on larger screens to preserve table readability */
.table-responsive table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
}

.table-responsive th,
.table-responsive td {
    /* default keep nowrap for desktop, overridden on small screens */
    white-space: nowrap;
}

@media (max-width: 768px) {
    .table-responsive th,
    .table-responsive td {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

table {
    width: max(100%, var(--table-min-width, 780px));
    min-width: var(--table-min-width, 780px);
    border-collapse: collapse;
    table-layout: auto;
}

thead {
    background: linear-gradient(180deg, rgba(246, 243, 255, 0.95), rgba(255, 255, 255, 0.98));
}

th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6e6687;
    white-space: nowrap;
    line-height: 1.35;
}

.table-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.table-heading__icon {
    width: 0.92rem;
    height: 0.92rem;
    color: var(--primary);
    opacity: 0.85;
    flex-shrink: 0;
}

.table-heading__label {
    display: inline-block;
}

th .sort-indicator {
    margin-left: 0.45rem;
}

td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: top;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.table-responsive th,
.table-responsive td {
    min-width: 0;
}

.table-responsive td > * {
    max-width: 100%;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.font-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.85rem; }
.font-bold { font-weight: 700; }

tbody tr:hover {
    background: rgba(109, 40, 217, 0.035);
}

/* Forms */
form {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 245, 255, 0.9));
    backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: var(--card-radius);
    border: 1px solid rgba(109, 40, 217, 0.12);
    box-shadow: var(--shadow-soft);
    max-width: 100%;
}

form.inline,
form.form-compact {
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border: 0;
    box-shadow: none;
    width: auto;
    max-width: none;
}

form.inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

form.form-compact {
    margin: 0;
}

form.form-compact input,
form.form-compact select,
form.form-compact textarea {
    width: auto;
    margin-bottom: 0;
}

input, select, textarea {
    background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%) !important;
    border: 1px solid rgba(109, 40, 217, 0.12) !important;
    border-radius: 1rem !important;
    padding: 0.82rem 1.2rem !important;
    color: var(--text-main) !important;
    font-family: inherit;
    transition: var(--transition-smooth);
    width: 100%;
    min-width: 0;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 18px -18px rgba(109, 40, 217, 0.45);
}

input:focus, select:focus {
    outline: none;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12), 0 16px 24px -18px rgba(109, 40, 217, 0.45);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
    min-width: 0;
    flex: 1 1 260px;
}

.search-wrapper i {
    position: absolute;
    left: 1.15rem;
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
}

.search-wrapper input {
    padding-left: 2.75rem !important;
    margin-bottom: 0 !important;
    height: 42px !important;
    border-radius: 2rem !important;
    border: 1px solid var(--border-glass) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 14px 24px -22px rgba(109, 40, 217, 0.28);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.filter-group > * {
    min-width: 0;
    max-width: 100%;
}

.filter-group select {
    margin-bottom: 0 !important;
    height: 42px !important;
    border-radius: 2rem !important;
    width: auto !important;
    min-width: 150px;
    padding: 0 1.25rem !important;
    padding-right: 2.5rem !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(109, 40, 217, 0.12) !important;
    cursor: pointer;
    font-size: 0.85rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d6a85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
}

/* Buttons */
.btn, button {
    padding: 0.82rem 1.45rem;
    border-radius: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary, button[type="submit"] {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 20px 30px -22px rgba(109, 40, 217, 0.75);
}

.btn-primary:hover, button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 32px -20px rgba(109, 40, 217, 0.56);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-muted);
    font-weight: 700;
    box-shadow: 0 14px 22px -20px rgba(109, 40, 217, 0.42);
}

.page-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 58, 237, 0.3);
}

.page-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 12px 20px -12px rgba(124, 58, 237, 0.55);
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.table-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1em;
    margin-left: 0.35rem;
    font-size: 0.8em;
    color: var(--primary);
}

/* Auth Page */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 18% 18%, rgba(139, 92, 246, 0.18), transparent 24%),
        radial-gradient(circle at 82% 20%, rgba(196, 181, 253, 0.75), transparent 20%),
        linear-gradient(180deg, #f8f6ff 0%, #f2efff 100%);
    padding: 2rem;
}

body.auth-page::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.26), transparent 42%);
    z-index: -1;
}

.auth-container {
    width: 100%;
    max-width: 470px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 255, 0.93));
    backdrop-filter: blur(24px);
    border: 1px solid rgba(109, 40, 217, 0.14);
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 42px 80px -40px rgba(76, 29, 149, 0.3);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.auth-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-feature-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: -0.25rem 0 1.35rem;
}

.auth-feature-pill {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.25), transparent 34%),
        linear-gradient(180deg, transparent 0%, rgba(109, 40, 217, 0.03) 100%);
    pointer-events: none;
}

.auth-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status Badges */
.status-badge {
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-active, .status-present { background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-inactive, .status-absent { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.status-overtime { background: rgba(168, 85, 247, 0.14); color: #7c3aed; border: 1px solid rgba(168, 85, 247, 0.2); }

/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.status-present { background-color: var(--accent-success); box-shadow: 0 0 8px var(--accent-success); }
.status-dot.status-late { background-color: var(--accent-warning); box-shadow: 0 0 8px var(--accent-warning); }
.status-dot.status-absent { background-color: var(--accent-error); box-shadow: 0 0 8px var(--accent-error); }
.status-dot.status-default { background-color: var(--text-muted); }

/* Clock Widget */
.clock-widget {
    background: rgba(255, 255, 255, 0.92);
    padding: 0.55rem 1.05rem;
    border-radius: 2rem;
    border: 1px solid rgba(109, 40, 217, 0.12);
    font-weight: 700;
    color: var(--accent-info);
    box-shadow: 0 18px 28px -24px rgba(109, 40, 217, 0.42);
}

.sidebar-status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.top-clock-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-shell {
    display: grid;
    gap: 1.75rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 1.5rem;
    align-items: stretch;
}

.dashboard-hero__intro {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--card-radius) + 0.2rem);
    border: 1px solid rgba(109, 40, 217, 0.1);
    background:
        radial-gradient(circle at top right, rgba(196, 181, 253, 0.7), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 241, 255, 0.94) 100%);
    box-shadow: var(--shadow-card);
    padding: 2rem 2rem 2.2rem;
}

.dashboard-hero__intro::after {
    content: '';
    position: absolute;
    right: -56px;
    bottom: -72px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.14), transparent 65%);
    pointer-events: none;
}

.dashboard-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(109, 40, 217, 0.08);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.dashboard-hero__title {
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
    color: var(--text-heading);
    margin-bottom: 0.85rem;
}

.dashboard-hero__subtitle {
    max-width: 60ch;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.dashboard-hero__highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.dashboard-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(109, 40, 217, 0.1);
    padding: 0.72rem 0.95rem;
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 14px 24px -24px rgba(109, 40, 217, 0.32);
}

.dashboard-hero__chip i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.dashboard-admin-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
    border-radius: calc(var(--card-radius) + 0.2rem);
    border: 1px solid rgba(109, 40, 217, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 243, 255, 0.94));
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    min-width: 0;
    transition: var(--transition-smooth);
}

.dashboard-admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 46px -34px rgba(76, 29, 149, 0.3);
}

.dashboard-admin-card__avatar {
    width: 68px;
    height: 68px;
    border-radius: 1.35rem;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(109, 40, 217, 0.12);
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    box-shadow: var(--shadow-glow);
}

.dashboard-admin-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-admin-card__content {
    min-width: 0;
    display: grid;
    gap: 0.22rem;
    flex: 1 1 200px;
}

.dashboard-admin-card__label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-admin-card__name {
    font-size: 1.1rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-admin-card__meta {
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-admin-card__action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(109, 40, 217, 0.08);
    color: var(--primary);
    flex-shrink: 0;
}

.dashboard-admin-card__action i {
    width: 16px;
    height: 16px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.1rem;
}

.metric-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: 1.4rem;
    border: 1px solid rgba(109, 40, 217, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 255, 0.92));
    padding: 1.3rem;
    box-shadow: 0 18px 36px -30px rgba(76, 29, 149, 0.24);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: auto -16px -26px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.18), transparent 66%);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 44px -34px rgba(76, 29, 149, 0.34);
}

.metric-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 1rem;
    background: rgba(109, 40, 217, 0.1);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-card__icon--blue { background: rgba(124, 58, 237, 0.1); color: #6d28d9; }
.metric-card__icon--amber { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.metric-card__icon--green { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.metric-card__icon--red { background: rgba(220, 38, 38, 0.12); color: #dc2626; }

.metric-card__icon i {
    width: 22px;
    height: 22px;
}

.metric-card__content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.metric-card__label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.metric-card__value {
    font-size: 1.7rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-heading);
}

.metric-card__link {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.dashboard-main {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.65fr);
    gap: 1.5rem;
}

.dashboard-secondary {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.85fr);
    gap: 1.5rem;
}

.dashboard-panel {
    border-radius: var(--card-radius);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 255, 0.92));
    border: 1px solid rgba(109, 40, 217, 0.1);
    box-shadow: var(--shadow-card);
}

.dashboard-panel__cta {
    text-decoration: none;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pulse-list,
.holiday-list {
    padding: 1.35rem;
    display: grid;
    gap: 0.85rem;
}

.pulse-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(109, 40, 217, 0.08);
}

.person-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.person-pill__avatar {
    width: 42px;
    height: 42px;
    border-radius: 1rem;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 1px solid rgba(109, 40, 217, 0.12);
}

.person-pill__avatar--small {
    width: 38px;
    height: 38px;
    border-radius: 0.9rem;
}

.person-pill__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-pill__content {
    min-width: 0;
    display: grid;
    gap: 0.08rem;
}

.person-pill__content strong {
    color: var(--text-heading);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-pill__content span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.dashboard-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(109, 40, 217, 0.08);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.dashboard-live-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.12);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    padding: 1.35rem;
}

.analytics-card {
    border-radius: 1.15rem;
    border: 1px solid rgba(109, 40, 217, 0.08);
    background: rgba(255, 255, 255, 0.85);
    padding: 1.15rem;
    min-width: 0;
}

.analytics-card__header {
    margin-bottom: 1rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.analytics-card__canvas {
    height: 300px;
}

.holiday-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(109, 40, 217, 0.08);
}

.holiday-item__date {
    min-width: 56px;
    padding: 0.55rem 0.5rem;
    border-radius: 0.95rem;
    background: rgba(109, 40, 217, 0.08);
    text-align: center;
}

.holiday-item__date span {
    display: block;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.holiday-item__date strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-heading);
}

.holiday-item__content {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.holiday-item__content strong {
    color: var(--text-heading);
    font-size: 0.92rem;
}

.holiday-item__content span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.dashboard-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

@media (max-width: 1280px) {
    :root { --sidebar-width: 240px; }
    .content { padding: 2rem; }
    .dashboard-main,
    .dashboard-secondary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    :root { --sidebar-width: 220px; }
    .sidebar h2 { font-size: 1rem; }
    .sidebar a { padding: 0.75rem 1rem; gap: 0.75rem; }
    .sidebar a span { font-size: 0.8rem; }
    .content { padding: 1.5rem; }
    .dashboard-widgets { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .dashboard-hero {
        grid-template-columns: 1fr;
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    th, td { padding: 0.9rem 1rem; }
    table {
        width: max(100%, min(var(--table-min-width, 780px), 860px));
        min-width: min(var(--table-min-width, 780px), 860px);
    }
}

@media (max-width: 768px) {
    .app-container {
        display: block;
    }
    .mobile-topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 1rem;
        position: sticky;
        top: 0;
        z-index: 120;
        padding: 0.9rem 1rem;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border-glass);
    }
    .mobile-topbar__brand {
        font-size: 1rem;
        font-weight: 800;
        color: var(--text-heading);
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-menu-btn {
        width: 42px;
        height: 42px;
        border-radius: 0.85rem;
        background: #ffffff;
        border: 1px solid var(--border-glass);
        color: var(--text-main);
        box-shadow: 0 8px 18px -12px rgba(124, 58, 237, 0.35);
    }
    .mobile-menu-btn:hover {
        transform: none;
        box-shadow: 0 8px 18px -12px rgba(124, 58, 237, 0.35);
    }
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 109;
    }
    .sidebar-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }
    .mobile-topbar .clock-widget {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        padding-inline: 0.75rem;
        font-size: 0.76rem !important;
    }
    .sidebar {
        position: fixed;
        left: -100%;
        width: 260px;
        min-width: 260px;
        height: 100vh;
        background: #ffffff;
        border-right: 1px solid var(--border-glass);
        z-index: 110;
    }
    .sidebar.is-open { left: 0; }
    .content {
        padding: 1rem;
    }
    .page-header,
    .card-header {
        align-items: stretch;
    }
    .page-header > *,
    .card-header > * {
        min-width: 0;
    }
    .page-header .btn,
    .page-header button,
    .card-header .btn,
    .card-header button {
        width: 100%;
    }
    .search-wrapper,
    .filter-group,
    .filter-group select {
        max-width: 100%;
        width: 100%;
    }
    .filter-group select {
        min-width: 0;
    }
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
    .dashboard-shell {
        gap: 1.25rem;
    }
    .dashboard-hero__intro,
    .dashboard-admin-card {
        padding: 1.4rem;
    }
    .dashboard-hero__title {
        font-size: 2.25rem;
    }
    .dashboard-admin-card__name,
    .dashboard-admin-card__meta,
    .person-pill__content strong {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        overflow-wrap: anywhere;
    }
    .person-pill__content span,
    .holiday-item__content span,
    .holiday-item__content strong {
        overflow-wrap: anywhere;
    }
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
    .metric-card {
        padding: 1.05rem;
    }
    .pulse-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-container [style*="grid-template-columns: 1fr 1fr"],
    .page-container [style*="grid-template-columns: 1fr 3fr"],
    .page-container [style*="grid-template-columns: 3fr 1fr"],
    .page-container [style*="repeat(auto-fit, minmax(300px, 1fr))"],
    .page-container [style*="repeat(auto-fill, minmax(280px, 1fr))"],
    .page-container [style*="repeat(auto-fill, minmax(180px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
    .page-container [style*="display: flex; gap: 1rem"],
    .page-container [style*="display: flex; gap: 0.75rem"] {
        flex-wrap: wrap;
    }
    .page-container [style*="max-width: 600px"],
    .page-container [style*="max-width: 700px"] {
        max-width: 100% !important;
    }
    .page-container [style*="width: min(420px, 92vw)"],
    .page-container [style*="width: min(360px, 94vw)"] {
        width: 100% !important;
    }
    .page-container [style*="justify-content: flex-end"] {
        justify-content: stretch !important;
    }
    .flash-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
    .auth-container {
        max-width: 100%;
        padding: 2rem 1.25rem;
        margin: 1rem;
    }
    form {
        padding: 1.25rem;
    }
    th, td {
        padding: 0.8rem 0.9rem;
    }
    table {
        width: max(100%, min(var(--table-min-width, 780px), 680px));
        min-width: min(var(--table-min-width, 780px), 680px);
    }
}

@media (max-width: 640px) {
    .widget, .card {
        border-radius: 1rem;
    }
    .card-header {
        padding: 1rem 1.1rem;
        min-height: auto;
    }
    .page-header h1 {
        font-size: 1.6rem;
    }
    .clock-widget {
        width: 100%;
        text-align: center;
    }
    .top-clock-row {
        justify-content: stretch;
    }
    th {
        font-size: 0.68rem;
    }
    td {
        font-size: 0.85rem;
    }
    table {
        width: max(100%, min(var(--table-min-width, 780px), 560px));
        min-width: min(var(--table-min-width, 780px), 560px);
    }
}

@media (max-width: 480px) {
    .mobile-topbar {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .mobile-topbar .clock-widget {
        grid-column: 1 / -1;
    }
    .content {
        padding: 0.85rem;
    }
    body.auth-page {
        padding: 1rem;
    }
    .auth-container {
        margin: 0;
        padding: 1.4rem 1rem;
    }
}

/* SweetAlert 2 Custom Classes */
.swal-custom-popup {
    background:
        radial-gradient(circle at top right, rgba(196, 181, 253, 0.65), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 243, 255, 0.94)) !important;
    backdrop-filter: blur(24px) !important;
    border-radius: 2rem !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
    box-shadow: 0 34px 80px -42px rgba(32, 26, 55, 0.45) !important;
    padding: 1.2rem 1.2rem 1rem !important;
}

.swal-custom-title {
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    color: var(--text-heading) !important;
    letter-spacing: -0.03em !important;
}

.swal-custom-actions {
    gap: 0.9rem;
    margin-top: 1.6rem !important;
    padding: 0 1.4rem 1.1rem !important;
}

.swal-custom-html,
.swal2-html-container {
    color: var(--text-muted) !important;
    padding: 0 1.4rem !important;
    margin-top: 0.35rem !important;
}

.swal-custom-body {
    display: grid;
    gap: 0.95rem;
    text-align: left;
}

.swal-custom-body p {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.6;
}

.swal-custom-tip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(109, 40, 217, 0.08);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 700;
}

.swal-custom-tip__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.1);
}

.swal-custom-tip__dot--danger {
    background: #dc2626;
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.1);
}

.swal-custom-tip__dot--primary {
    background: #7c3aed;
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.1);
}

.swal2-icon.swal2-warning {
    border-color: var(--accent-warning) !important;
    color: var(--accent-warning) !important;
}

.swal2-icon.swal2-question {
    border-color: rgba(124, 58, 237, 0.22) !important;
    color: var(--primary) !important;
}

.swal2-styled.swal2-confirm {
    background: var(--primary-gradient) !important;
    border-radius: 1rem !important;
    padding: 0.9rem 1.2rem !important;
    min-width: 150px !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em !important;
    box-shadow: 0 18px 36px -22px rgba(109, 40, 217, 0.45) !important;
}

.swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.82) !important;
    border-radius: 1rem !important;
    color: var(--text-main) !important;
    padding: 0.9rem 1.2rem !important;
    min-width: 130px !important;
    font-weight: 800 !important;
    border: 1px solid rgba(109, 40, 217, 0.1) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6) !important;
}

.swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-cancel:hover {
    transform: translateY(-1px) !important;
}

.swal-custom-footer {
    margin: 0 !important;
    padding: 0 1.4rem 1.2rem !important;
    border-top: none !important;
    color: var(--text-muted) !important;
    font-size: 0.76rem !important;
    text-align: left !important;
}

.swal-show {
    animation: swalPopIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.swal-hide {
    animation: swalPopOut 0.18s ease forwards;
}

@keyframes swalPopIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes swalPopOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

/* ── Action Buttons (Check / X / Trash) ─────────────────────────────────── */
.btn-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: transform 0.15s, opacity 0.2s !important;
    background: #334155 !important;
    color: #e2e8f0 !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
}

.btn-action svg {
    width: 15px !important;
    height: 15px !important;
    stroke: #e2e8f0 !important;
    fill: none !important;
    display: block !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
}

.btn-action:hover {
    transform: scale(1.1) !important;
    opacity: 0.85 !important;
}

/* Approve / Check - Green */
.btn-approve {
    background: #16a34a !important;
}
.btn-approve svg {
    stroke: #ffffff !important;
}

/* Reject / X - Amber */
.btn-reject {
    background: #b45309 !important;
}
.btn-reject svg {
    stroke: #ffffff !important;
}

/* Delete / Trash - Red */
.btn-delete {
    background: #dc2626 !important;
}
.btn-delete svg {
    stroke: #ffffff !important;
}
