/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    /* ======= Universal Palette ======= */
    --navy: #0C4983;
    --navy-light: #155a9e;
    --navy-dark: #093864;
    --ghostwhite: #f8f8ff;
    --accent-orange: #ff8c00;

    /* ======= Semantic Usage ======= */
    --bg-main: var(--ghostwhite);
    --bg-card: #ffffff;
    --bg-surface: #ffffff;

    --text-primary: var(--navy);
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-primary: var(--navy);
    --accent-hover: var(--navy-light);

    --border-light: #e2e8f0;
    --border-color: #cbd5e1; /* Added to fix undefined variable errors */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-soft: 0 10px 30px rgba(12, 73, 131, 0.08);

    --bg-secondary: #f1f5f9;

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --primary-gradient: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    --glass-bg: rgba(255, 255, 255, 0.8);

    --btn-primary: var(--navy);
    --btn-primary-hover: var(--navy-light);
}


body {
    min-height: 100vh;
    background-color: #fff;
    background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1) 1px, transparent 1px, transparent 50px), linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1) 1px, transparent 1px, transparent 50px);
    background-size: 50px 50px;
}

button {
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--navy);
    color: white;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(34, 34, 59, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 34, 59, 0.25);
    filter: brightness(1.1);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--navy);
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(34, 34, 59, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 34, 59, 0.1);
}

/* --- SHARED COMPONENTS --- */
.table-container {
    background: #fff;
    border: 1px solid var(--navy);
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--navy);
}

.data-table th {
    background: var(--ghostwhite);
    font-weight: 700;
    color: var(--navy);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(12, 73, 131, 0.02);
}

.data-table td {
    color: #334155;
    vertical-align: middle;
}

/* --- Standard Close Button --- */
.btn-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    background: rgba(241, 245, 249, 0.8);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.btn-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-close i {
    pointer-events: none;
}

/* Tiny modifier for row/list actions */
.btn-close.tiny {
    position: static; /* Let it sit in flow */
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    background: #f1f5f9;
}

.btn-close.tiny:hover {
    transform: rotate(90deg) scale(1.15);
}

/* Loader */
.loader {
    width: 15px;
    aspect-ratio: 1;
    border-radius: 50%;
    animation: l5 1s infinite linear alternate;
    display: inline-block;
    vertical-align: middle;
}
@keyframes l5 {
    0%  {box-shadow: 20px 0 currentColor, -20px 0 rgba(0,0,0,0.1);background: currentColor }
    33% {box-shadow: 20px 0 currentColor, -20px 0 rgba(0,0,0,0.1);background: rgba(0,0,0,0.1)}
    66% {box-shadow: 20px 0 rgba(0,0,0,0.1),-20px 0 currentColor; background: rgba(0,0,0,0.1)}
    100%{box-shadow: 20px 0 rgba(0,0,0,0.1),-20px 0 currentColor; background: currentColor }
}