/* --- Font Definitions --- */
@font-face { font-family: 'GT Walsheim'; src: url('../fonts/subset-GTWalsheimLC-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'GT Walsheim'; src: url('../fonts/subset-GTWalsheimLC-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'GT Walsheim'; src: url('../fonts/subset-GTWalsheimLC-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

/* --- Variables & Base --- */
:root {
    --apple-blue: #3772fe;
    --apple-blue-hover: #4B80FE;
    --apple-light-blue: #ebf1ff;
    
    --text-main: #111827;
    --text-muted: #6B7280;

    --border-glass: rgba(255, 255, 255, 0.6);
    --glass-surface: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --warning-text: #f97316;
    --warning-bg: #fff7ed;

    --error-text: #DC2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
}

html {
    scrollbar-gutter: stable;
}

*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: #e5e7eb; }
*:focus-visible { outline: 2px solid #e5e7eb; outline-offset: 5px; }

body {
    margin: 0;
    background-color: #F3F4F6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.1) 0px, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'GT Walsheim', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

/* --- Layout & Utilities --- */
.container { max-width: 1024px; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-start { align-items: start; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-05 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.rounded-full { border-radius: 9999px; }

.max-w-xs {
    max-width: 20rem;
}

/* Spacing */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; line-height: 1.4em; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }

.leading-none { line-height: 1; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-wrap-balance { text-wrap: balance; }

.truncate {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.cursor-default { cursor: default; }
.select-none { user-select: none; }
.whitespace-nowrap { white-space: nowrap; }

/* Colors & States */
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-blue { color: var(--apple-blue); }
.hover-opacity:hover { opacity: 0.8; transition: opacity 0.2s; }
.opacity-70 { opacity: 0.7; }

/* --- Components --- */

/* Navigation */
.glass-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky; top: 0; z-index: 50; backface-visibility: hidden;
}

/* Panels & Cards */
.panel {
    background: var(--glass-surface);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glass-shadow);
    border-radius: 1.5rem;
}

.panel-xs { padding: 0.75rem 1rem; border-radius: 0.75rem; }
.panel-sm { padding: 1.25rem 1.5rem; border-radius: 1rem; }
.panel-lg { padding: 2.5rem 2.75rem; }

.group-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: 2.5rem;
    margin-bottom: -1rem;
}


/* Base Container (Purely Visual) */
.card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-radius: 1.25rem;
    padding: 1.5rem;
}

.card-fx {
    transition: all 0.3s ease;
    cursor: pointer;
}
.card-fx:focus-visible, 
.card-fx:hover {
    outline: none !important;
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-arrow {
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card-fx:hover .card-arrow {
    stroke: var(--apple-blue);
    transform: translateX(5px);
}




/* Badges */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.5rem; border-radius: 0.5rem;
    font-size: 0.75rem; font-weight: 500;
}
.badge-lg { padding: 0.5rem 1rem; border-radius: 0.75rem; flex-direction: column; }
.badge-blue { background: var(--apple-light-blue); color: var(--apple-blue); border: 1px solid rgba(55, 114, 254, 0.2); }
.badge-red { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }

/* Data Tables */
.data-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.data-table th { 
    padding: 1rem; font-size: 0.75rem; font-weight: 500; 
    text-transform: uppercase; color: var(--text-muted); text-align: left; 
}
.data-table td { padding: 1rem; font-size: 0.875rem; border-bottom: 1px solid rgba(0,0,0,0.05); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th.text-right, .data-table td.text-right { text-align: right; }

.col-date { width: 110px; }
.col-user { width: 130px; }
.col-time { width: 75px; }

/* Status Box & Progress */
.status-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; padding: 1.25rem; background: rgba(0, 0, 0, 0.03); border-radius: 1.25rem;
}
.progress-circle svg { display: block; width: 100px; height: 100px; }
.progress-circle circle { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.progress-circle circle.meter { transform: rotate(-90deg); transform-origin: center; }

.state-normal { 
    background: linear-gradient(to right, var(--apple-light-blue), transparent); 
    color: var(--apple-blue); 
}

.state-warning { 
    background: linear-gradient(to right, var(--warning-bg), transparent); 
    color: var(--warning-text); 
}

.state-exceed { 
    background: linear-gradient(to right, var(--error-bg), transparent); 
    color: var(--error-text); 
}


/* Base Button */
.btn {
    display: inline-block;
    line-height: normal;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: pointer;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Button Presets */
.btn-primary {
    background-color: var(--apple-blue);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--apple-blue-hover);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border-color: #e2e8f0;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    border-color: #cbd5e1;
}

/* Button Effects */
.btn-fx {
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, box-shadow;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}
.btn-fx:focus-visible, .btn-fx:hover {
    outline: none !important;
    transform: translateY(-1px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12); 
}
.btn-fx:active { 
    transform: translateY(-1px) scale(0.98); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    border-radius: 0.5rem;
}
.btn-sm.btn-fx {
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.03);
}


.export-link {
    position: relative;
}
.export-link svg {
    position: absolute;
    left: -7px;
}


/* Forms */
.input-field {
    width: 100%; padding: 14px 18px;
    background-color: rgba(255, 255, 255, 0.5); border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem; outline: none; font-size: 16px; transition: all 0.2s;
}
.input-field:focus { background-color: #FFFFFF; box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15); }

.select-field {
    padding-right: 30px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236B7280%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 10px auto;
}


/* Alerts & Misc */
.alert-error { background-color: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); padding: 0.75rem; border-radius: 0.5rem; text-align: center; font-size: 0.875rem; }
.notes-box { background-color: rgba(0, 0, 0, 0.04); border-radius: 0.75rem; padding: 0.75rem; margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-main); white-space: pre-wrap; word-break: break-all; }


/* Expandable Groups */
.entries-wrapper {
    padding-bottom: 1rem;
    overflow: hidden;
}
.entries-wrapper[aria-expanded="false"] {
    max-height: 380px; 
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.entries-wrapper[aria-expanded="true"] {
    max-height: none; 
    -webkit-mask-image: none;
    mask-image: none;
}
.expand-actions {
    text-align: center;
    z-index: 1;
}
.entries-wrapper[aria-expanded="false"] + .expand-actions {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
}
.entries-wrapper[aria-expanded="true"] + .expand-actions {
    position: sticky;
    bottom: 0; 
    padding-bottom: 2rem;
}



/* Tabs */
.tab-link {
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.tab-link.active-tab {
    border-bottom-color: var(--apple-blue);
    color: var(--apple-blue);
}


/* Native HTML5 Dialog */
dialog {
    margin: auto;
    padding: 0;
    background: transparent;
    overflow: visible;
}
dialog::backdrop {
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal Specific Utilities */
.dialog-panel {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
}
.dialog-close {
    cursor: pointer;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.05);
}




@media (max-width: 1024px) {
    body {
        display: none;
    }
}