/**
 * Mimir File Management System - Main Stylesheet
 */

/* ===== CSS Variables ===== */
:root {
    /* Brand colors - can be overridden by inline styles */
    --brand-primary: #1e40af;
    --brand-secondary: #475569;
    --brand-accent: #0ea5e9;
    
    /* System colors - professional palette */
    --primary-color: var(--brand-primary);
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: var(--brand-secondary);
    --accent-color: var(--brand-accent);
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: var(--brand-accent);
    
    /* Neutral palette - professional grays */
    --bg-color: #f8fafc;
    --bg-main: #ffffff;
    --bg-secondary: #f1f5f9;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    /* Legacy / compatibility aliases used across templates */
    --text-main: var(--text-primary);
    --text-on-primary: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Layout */
    --sidebar-width: 250px;
    --header-height: 60px;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows - subtle and professional */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Primary color with opacity for professional effects */
    --primary: var(--brand-primary);
    /* Period button tuning */
    --period-bg: rgba(255,255,255,0.92);
    --period-border: rgba(0,0,0,0.06);
    --period-text: var(--text-primary);
    --period-hover-bg: rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* ===== Layout ===== */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background-color: #1a2847; border-right: 1px solid rgba(255,255,255,0.1); box-shadow: var(--shadow-sm); position: fixed; height: 100vh; overflow-y: auto; z-index: 100; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; background: rgba(8,10,20,0.6); }
.header { height: var(--header-height); background-color: var(--surface-color); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; box-shadow: var(--shadow-sm); }
/* Make header a positioning context for absolute dropdowns */
.header { position: relative; display: flex; }
.content { flex: 1; padding: 1.5rem; background: rgba(8,10,20,0.55); }

/* Top menu alignment: push menu items to the right and style user dropdown */
.menu-section { margin-left: auto; align-items: center; }
/* Prevent scrollbars: allow wrapping and hide horizontal overflow on narrow viewports */
.menu-section { display:flex; flex-wrap:wrap; gap:8px; max-width: calc(100% - 3rem); }
.menu-item { white-space: nowrap; }
.header { overflow-x: hidden; }
.sidebar { overflow: visible; }
.sidebar-menu { overflow: hidden; }
.menu-user { display: inline-flex; align-items: center; gap: 0.5rem; position: relative; padding: 0.35rem 0.6rem; border-radius: 6px; }
.menu-user:hover { background-color: var(--bg-color); }
.menu-user .menu-user-name { margin-left: 0.4rem; font-weight: 600; color: var(--text-secondary); }
.menu-user-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface-color); border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); border-radius: 8px; min-width: 140px; z-index: 250; overflow: hidden; }
.menu-user.open .menu-user-dropdown { display: block; }
.menu-user-dropdown .dropdown-item { display: block; padding: 0.6rem 0.9rem; color: var(--text-primary); text-decoration: none; }
.menu-user-dropdown .dropdown-item:hover { background: var(--bg-color); }
.menu-user .user-avatar { width: 32px; height: 32px; font-size: 0.95rem; }

@media (max-width: 700px) {
    .menu-user .menu-user-name { display: none; }
}

/* ==========================
   Modern colorful theme (Pi-hole-like)
   ========================== */
:root {
    --brand-primary: #3742fa;    /* vivid blue */
    --brand-accent: #1dd1a1;     /* mint */
    --brand-secondary: #3742fa;  /* vivid blue */
    --bg-color: #0f1724;         /* deep navy */
    --bg-main: linear-gradient(180deg,#08101a 0%, #0f1724 100%);
    --bg-secondary: rgba(255,255,255,0.02);
    --surface-color: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    --text-color: #e6eef8;
    --text-primary: #e6eef8;
    --text-secondary: #b8d3ff;
    --text-muted: #9fb7d6;
    --border-color: rgba(255,255,255,0.06);
}

body {
    background-image: url('images/background-clocks.svg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: #0f1724;
    color: var(--text-color);
}

/* Header and sidebar vibrant */
.header { background: #3742fa; color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.sidebar { background: #1a2847; border-right: 1px solid rgba(255,255,255,0.1); }
.sidebar .menu-item { color: #b8d3ff; padding: 0.75rem 1.5rem; }
.sidebar .menu-item:hover, .sidebar .menu-item.active { background: rgba(255,255,255,0.15); color: #ffffff; }

/* Cards: glassy, accented */
.card { background: rgba(21,30,46,0.9); border: 1px solid #2a3f5f; box-shadow: inset 0 1px 3px rgba(255,255,255,0.1), 0 8px 32px rgba(0,0,0,0.4); backdrop-filter: blur(10px); }
.card h1, .card h3, .card h4 { color: var(--text-primary); }
.dashboard-cards .card { background: #1a2639; border: 1px solid #2a3f5f; border-left: 4px solid var(--brand-accent); }

/* Buttons */
.btn-primary { background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary)); color: white; box-shadow: 0 6px 18px rgba(55,66,250,0.18); }
.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,0.06); color: var(--text-primary); }

/* Form controls */
.form-control, .form-select, .form-textarea { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); color: var(--text-primary); }
.form-control:focus { box-shadow: 0 6px 18px rgba(29,209,161,0.08); border-color: var(--brand-accent); }

/* Badges */
.badge { background: linear-gradient(90deg, var(--brand-accent), var(--brand-secondary)); color: #042026; font-weight:700; }
.badge-danger { background: linear-gradient(90deg,#ff6b81,#ff4757); color: white; }
.badge-primary { background: linear-gradient(90deg,#74b9ff,#3742fa); color: white; }

/* Table */
.sheet thead th { background: rgba(255,255,255,0.03); color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,0.04); }
.sheet tr { border-bottom: 1px solid rgba(255,255,255,0.02); }

/* Sparklines - accent stroke */
svg polyline { stroke: var(--brand-accent) !important; stroke-linecap: round; stroke-linejoin: round; }

/* User menu */
.menu-user { background: rgba(255,255,255,0.02); border-radius: 10px; padding: 6px 10px; }

/* Small responsive tweaks to keep airy spacing */
@media (max-width:900px){
  .dashboard-cards { grid-template-columns: 1fr !important; }
  .sidebar { display:none; }
}

/* subtle transitions */
* { transition: all 0.12s ease-in-out; }


/* ===== Sidebar ===== */
.sidebar-header { padding: 1.5rem; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); display: flex; align-items: center; gap: 0.75rem; }
.logo h1 { margin: 0; }
.logo img { max-height: 40px; max-width: 150px; width: auto; height: auto; object-fit: contain; }
/* Visually hidden utility for screen-readers (when logo image is present we hide textual site name) */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.sidebar-menu { padding: 1rem 0; }
.menu-section { margin-bottom: 1.5rem; }
.menu-section-title { padding: 0.5rem 1.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }

.header-brand { display: flex; align-items: center; gap: 0.5rem; }
.header-brand-logo { height: 32px; width: auto; }
.header-brand-text { font-weight: 600; font-size: 1rem; }

.sidebar-brand-visual { display: flex; align-items: center; gap: 0.5rem; padding: 8px 12px; }
.sidebar-brand-logo { height: 40px; width: auto; }
.sidebar-brand-text { font-weight: 700; font-size: 1.05rem; color:var(--text-color); }

/* Basic responsive behavior: when mobile-menu-open, slide sidebar over content */
body.mobile-menu-open .sidebar {
    transform: translateX(0);
}

/* Topbar layout: make sidebar act as a horizontal nav bar */
/* (This matches the UI you had: more horizontal room than a left sidebar.) */
.app-container { flex-direction: column; }
.sidebar { width: 100%; min-width: 100%; height: var(--header-height); border-right: none; border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-sm); display: flex; align-items: center; }
/* Keep topbar visible without overlaying content (better sticky offsets for tables) */
.sidebar { position: sticky; top: 0; z-index: 200; overflow: visible; }
.main-content { margin-left: 0; margin-top: 0; }
.menu-section { display: flex; gap: 8px; align-items: center; padding: 0 1rem; }
.menu-item { display: inline-flex; padding: 0.5rem 0.75rem; border-radius: 6px; }
.menu-item { display: flex; align-items: center; padding: 0.75rem 1.5rem; color: var(--text-color); transition: all 0.2s; cursor: pointer; }
.menu-item:hover { background-color: var(--bg-color); color: var(--primary-color); }
.menu-item.active { background-color: var(--primary-color); color: white; font-weight: 500; }
.menu-item i { margin-right: 0.75rem; width: 20px; text-align: center; }

/* ===== Header ===== */
.header-title { font-size: 1.25rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-brand { display: flex; align-items: center; gap: 0.6rem; margin-left: 0.5rem; }
.header-brand-logo { max-height: 36px; max-width: 140px; object-fit: contain; display: inline-block; }
.header-brand-text { font-weight: 700; color: var(--primary-color); font-size: 1rem; display: inline-block; }
.user-menu { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem; border-radius: var(--radius-md); cursor: pointer; transition: background-color 0.2s; }
.user-menu:hover { background-color: var(--bg-color); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; box-shadow: 0 2px 8px rgba(16,24,40,0.12); }
.user-avatar svg { width: 20px; height: 20px; fill: white; display: block; }

/* User dropdown styling (used by header dropdown) */
.user-dropdown { display: none; }
.user-dropdown.show { display: block; }

/* Sidebar vertical styling */
.app-container > .sidebar { display: flex; align-items: center; padding: 0 1rem; box-shadow: none; }
.app-container > .sidebar .sidebar-menu { display: flex; align-items: center; width: 100%; overflow: visible; }
.app-container > .sidebar .menu-section { margin-left: auto; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.app-container > .sidebar .menu-section .menu-item { padding: 0.45rem 0.85rem; }
.app-container > .sidebar .menu-section .menu-user { padding: 0.2rem 0.5rem; }

/* ===== Cards ===== */
.card { background-color: #1a2639; border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.4); border: 1px solid #2a3f5f; margin-bottom: 1.5rem; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #2a3f5f; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1.125rem; font-weight: 600; }
.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid #2a3f5f; background-color: #0f1724; }

/* Brandized card headers: use brand gradient and white text by default */
.card-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: var(--text-on-primary, #ffffff);
}
/* Dashboard-specific card tweaks */
.dashboard-cards .card { padding: 14px; display:flex; flex-direction:column; justify-content:space-between; min-height:110px; min-width:0; }
.dashboard-cards .card h4 { margin: 0 0 8px 0; font-size: 0.95rem; font-weight:600; color:var(--text-secondary); }
.dashboard-cards .card .muted { margin-top:6px; font-size:0.85rem; }
.dashboard-cards .card a.card-link { color: inherit; text-decoration: none; display:block; height:100%; }
.dashboard-cards .card .value { font-size:1.35rem; font-weight:700; color:var(--primary-color); }
.dashboard-cards .card .sparkline { width:100%; height:34px; display:block; overflow:hidden; }

/* Week balance cards: visual cues for positive (green) and negative (red) balances */
.week-cards .card.week-card { display:flex; align-items:center; gap:8px; padding:10px; min-width:220px; }
.week-cards .card.week-card.positive { border-left: 6px solid var(--success-color); color: var(--text-primary); }
.week-cards .card.week-card.positive strong { color: var(--success-color); }
.week-cards .card.week-card.negative { border-left: 6px solid var(--danger-color); color: var(--text-primary); }
.week-cards .card.week-card.negative strong { color: var(--danger-color); }

/* Table sparkline cell */
.sheet td .sparkline { width:160px; height:32px; display:inline-block; }

/* Make cards responsive */
@media (max-width: 720px) { .dashboard-cards { grid-template-columns: 1fr !important; } }

/* Wide card variant spans two columns on wider viewports */
.dashboard-cards .card.card--wide {
    grid-column: span 2;
}
@media (max-width: 900px) {
    .dashboard-cards .card.card--wide { grid-column: auto; }
}

/* Inside wide card: make inner week cards each take 50% of parent's width */
.card.card--wide .week-cards { display:flex; gap:12px; }
.card.card--wide .week-cards .card { flex: 1 1 50%; min-width: 0; }

/* Utility helpers to avoid inline styles */
.card-header--padded {
    padding: 1.5rem;
}
.card-header--flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bulk-actions-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: var(--text-on-primary, #ffffff);
    padding: 1rem 2rem;
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}
.bulk-actions-bar.show {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 500; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background-color: var(--primary-color); color: var(--text-on-primary); border-color: transparent; }

/* Period selector buttons (chart period) - ensure high contrast */
.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.period-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-on-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Ensure disk-period-btn matches period-btn styles */
.disk-period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.disk-period-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-on-primary);
}
.disk-period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Outline variant for buttons placed on dark/brand headers */
.btn-outline--on-dark {
    background: rgba(255,255,255,0.08);
    color: var(--text-on-primary);
    border-color: rgba(255,255,255,0.12);
    box-shadow: none;
}
.btn-outline--on-dark:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-on-primary);
    transform: translateY(-1px);
}

/* Unified bulk-actions-bar overrides (match admin/users.php compact branding) */
.app-container .main-content .bulk-actions-bar {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    gap: 0.5rem;
    font-size: 0.9rem;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 4rem);
    left: 50%;
    transform: translateX(-50%);
}

.app-container .main-content .bulk-actions-bar.show {
    display: flex !important;
}

.app-container .main-content .bulk-actions-bar .btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 999px;
    min-width: 36px;
    height: 36px;
    gap: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-container .main-content .bulk-actions-bar .btn .btn-label {
    display: inline-block;
}

/* Icon sizing and spacing */
.app-container .main-content .bulk-actions-bar i,
.app-container .main-content .bulk-actions-bar .icon { font-size: 1.05rem; line-height: 1; }

/* Responsive: hide labels on narrow screens to become icon-only */
@media (max-width: 900px) {
    .app-container .main-content .bulk-actions-bar { padding: 0.4rem 0.6rem; gap: 0.35rem; }
    .app-container .main-content .bulk-actions-bar .btn { padding: 0.35rem 0.45rem; }
    .app-container .main-content .bulk-actions-bar .btn .btn-label { display: none; }
}

/* Slight hover lift for buttons inside the bar */
.app-container .main-content .bulk-actions-bar .btn:hover { transform: translateY(-2px); }

/* Force high-specificity admin bulk bar rules to override per-page styles */
.main-content .bulk-actions-bar,
#bulkActionsBar,
body .bulk-actions-bar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%) !important;
    color: var(--text-on-primary) !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.24) !important;
    gap: 0.6rem !important;
    font-size: 0.95rem !important;
    max-width: calc(100% - 3rem) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

/* ==========================
   Light modern theme overrides
   ========================== */
:root {
    --brand-primary: #2563eb; /* muted blue */
    --brand-secondary: #64748b; /* slate gray */
    --brand-accent: #60a5fa; /* soft accent */

    --bg-color: #f7f8fb; /* very light background */
    --bg-main: #ffffff;
    --bg-secondary: #f1f5f9;
    --surface-color: #ffffff;
    --text-color: #0f172a;
    --text-primary: #0b1220;
    --text-secondary: #475569;
    --text-muted: #6b7280;
    --border-color: #e6edf3;
    --border-light: #f3f6f9;

    --shadow-sm: 0 1px 4px rgba(16,24,40,0.04);
    --shadow-md: 0 4px 12px rgba(16,24,40,0.06);
    --shadow-lg: 0 8px 24px rgba(16,24,40,0.08);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Header & Sidebar: light surfaces, subtle shadows */
.header {
    background: var(--surface-color);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.sidebar {
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    box-shadow: none;
}
.sidebar .menu-item, .menu-item { color: var(--text-secondary); }
.sidebar .menu-item:hover, .sidebar .menu-item.active { background: var(--bg-secondary); color: var(--text-primary); }

/* Cards: white surface, soft rounded corners and subtle shadow */
.card { background-color: var(--surface-color) !important; border-radius: 10px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.card-header { background: transparent !important; color: var(--text-primary) !important; border-bottom: 1px solid var(--border-light) !important; }
.dashboard-cards .card { border-left: 4px solid transparent; }
.dashboard-cards .card .value { color: var(--text-primary); }

/* Buttons: flat, single-color, subtle shadow */
.btn-primary { background: var(--brand-primary) !important; color: var(--text-on-primary, #ffffff) !important; box-shadow: var(--shadow-sm) !important; border: 1px solid rgba(0,0,0,0.04) !important; }
.btn-secondary { background: transparent !important; border: 1px solid var(--border-color) !important; color: var(--text-primary) !important; }
.period-btn, .disk-period-btn { background: var(--surface-color); border: 1px solid var(--border-color); color: var(--text-primary); box-shadow: none; }

/* Badges: neutral, low-saturation */
.badge { background: var(--bg-secondary); color: var(--text-primary); font-weight:600; }
.badge-danger { background: rgba(220,38,38,0.12); color: var(--danger-color, #dc2626); }
.badge-primary { background: rgba(37,99,235,0.12); color: var(--brand-primary); }

/* Forms: light inputs */
.form-control, .form-select, .form-textarea { background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-primary); box-shadow: none; }
.form-control:focus { box-shadow: 0 6px 18px rgba(37,99,235,0.06); border-color: var(--brand-primary); }

/* Sparklines stroke to match muted brand */
svg polyline { stroke: var(--brand-primary) !important; }

/* User menu simplified */
.menu-user { background: transparent; padding: 0.25rem 0.5rem; border-radius: 8px; box-shadow: none; }
.menu-user:hover { background: var(--bg-secondary); }

/* Bulk actions bar: neutral background */
.bulk-actions-bar { background: var(--surface-color); color: var(--text-primary); box-shadow: var(--shadow-md); border: 1px solid var(--border-color); }

/* Reduce heavy transitions for a cleaner feel */
* { transition: all 0.12s cubic-bezier(.2,.9,.3,1); }

/* Ensure the date column in sheets stays on a single line */
.sheet th:nth-child(1), .sheet td:nth-child(1) {
    white-space: nowrap;
    width: 1%;
}

/* Ensure action buttons (editar/borrar) remain on a single line */
.sheet th:last-child, .sheet td:last-child {
    white-space: nowrap;
    width: 1%;
}
.sheet td:last-child .btn,
.sheet td:last-child .edit-entry,
.sheet td:last-child .delete-entry {
    display: inline-block;
    white-space: nowrap;
    margin-right: 6px;
    vertical-align: middle;
}
.sheet td:last-child .btn:last-child { margin-right: 0; }

/* Compact table mode to avoid horizontal overflow */
.sheet.compact { font-size: 13px; }
.sheet.compact th, .sheet.compact td { padding: 6px 8px; line-height: 1.2; }
.sheet.compact .card-body { padding: 8px; }

/* Smaller buttons inside tables */
.sheet.compact .btn { padding: 4px 8px; font-size: 0.82rem; }
.sheet.compact .btn.btn-danger { padding: 4px 7px; background-color: var(--danger-color) !important; color: #ffffff !important; border-color: transparent !important; }

/* Fixed column widths for critical compacting (date, time columns, actions) */
.sheet.compact th:nth-child(1), .sheet.compact td:nth-child(1) { width: 95px; }
.sheet.compact th:nth-child(2), .sheet.compact td:nth-child(2),
.sheet.compact th:nth-child(3), .sheet.compact td:nth-child(3),
.sheet.compact th:nth-child(4), .sheet.compact td:nth-child(4),
.sheet.compact th:nth-child(6), .sheet.compact td:nth-child(6),
.sheet.compact th:nth-child(7), .sheet.compact td:nth-child(7),
.sheet.compact th:nth-child(9), .sheet.compact td:nth-child(9) { width: 70px; }
.sheet.compact th:nth-child(11), .sheet.compact td:nth-child(11) { width: 85px; }
.sheet.compact th:nth-child(12), .sheet.compact td:nth-child(12) { width: 140px; }

/* Table container: keep full height; only use horizontal scroll when needed */
.table-responsive { overflow: visible; max-width: 100%; }

@media (max-width: 900px) {
    .sheet.compact th, .sheet.compact td { padding: 5px 6px; font-size: 12px; }
    .sheet.compact th:nth-child(1), .sheet.compact td:nth-child(1) { width: 90px; }
    .sheet.compact th:nth-child(12), .sheet.compact td:nth-child(12) { width: 110px; }
    .sheet.compact .btn { padding: 3px 6px; font-size: 0.78rem; }
}

/* More aggressive compacting: fixed table layout and truncation */
.sheet.compact { table-layout: fixed; }
.sheet.compact td, .sheet.compact th { overflow: hidden; text-overflow: ellipsis; }
.sheet.compact td:nth-child(12), .sheet.compact th:nth-child(12) { white-space: nowrap; }

/* Icon buttons style */
.icon-btn { padding: 4px 6px; width: 30px; text-align: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }

/* Responsive: hide less important columns on narrower screens to save space */
@media (max-width: 1100px) {
    /* hide coffee time columns */
    .sheet.compact th:nth-child(3), .sheet.compact td:nth-child(3),
    .sheet.compact th:nth-child(4), .sheet.compact td:nth-child(4) { display: none; }
}
@media (max-width: 900px) {
    /* hide coffee balance and lunch columns */
    .sheet.compact th:nth-child(5), .sheet.compact td:nth-child(5),
    .sheet.compact th:nth-child(6), .sheet.compact td:nth-child(6),
    .sheet.compact th:nth-child(7), .sheet.compact td:nth-child(7),
    .sheet.compact th:nth-child(8), .sheet.compact td:nth-child(8) { display: none; }
}
@media (max-width: 700px) {
    /* hide day balance and note to keep essential columns */
    .sheet.compact th:nth-child(11), .sheet.compact td:nth-child(11),
    .sheet.compact th:nth-child(12), .sheet.compact td:nth-child(12) { display: none; }
}

/* Prevent hiding of action/global columns for tables explicitly marked no-hide-actions */
.sheet.compact.no-hide-actions th:last-child, .sheet.compact.no-hide-actions td:last-child,
.sheet.compact.no-hide-actions th:nth-last-child(2), .sheet.compact.no-hide-actions td:nth-last-child(2) {
    display: table-cell !important;
}

/* Ensure buttons inside tables are visible and high-contrast */
.sheet .btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-primary) !important;
        padding: 4px 6px !important;
        min-width: 28px;
        height: 28px;
        line-height: 1;
        box-shadow: none;
}
.sheet .btn.btn-primary { background: var(--brand-primary) !important; color: #fff !important; border-color: transparent !important; }
.sheet .btn.btn-danger { background-color: var(--danger-color) !important; color: #ffffff !important; border-color: transparent !important; }
.sheet .icon-btn { width: 28px; padding: 0 6px; font-size: 14px; }

/* If buttons are hidden via display:none by responsive rules, ensure action column shows at least icons */
.sheet.compact td:last-child, .sheet.compact th:last-child { display: table-cell !important; }
.sheet.compact th:nth-child(13), .sheet.compact td:nth-child(13),
.sheet.compact th:nth-child(12), .sheet.compact td:nth-child(12) {
    display: table-cell !important;
    width: 80px !important;
    min-width: 60px !important;
}
.sheet.compact td:last-child .icon-btn { font-size: 14px !important; color: var(--text-primary) !important; }

/* Holiday & year action helpers (moved from inline/debug styles) */
.holiday-global { text-align: center; width: 80px; }
.holiday-actions { white-space: nowrap; text-align: right; }
.holiday-actions .btn, .yc-actions .btn { display: inline-block; }
.holiday-actions form, .yc-actions form { display: inline; margin-left: 6px; }
.yc-actions .btn-danger { padding: 4px 6px; height: 28px; }
/* Ensure svg icons inside danger buttons are white */
.btn-danger svg, .sheet .btn.btn-danger svg { fill: #ffffff !important; color: #ffffff !important; }

/* Highlight edit button appearance (was applied inline during debugging) */
.highlight-edit-btn { background: linear-gradient(90deg,#ffd54d,#ffb74d); color:#1b1b1b; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }

/* Highlight row that is in inline-edit mode */
.sheet tr.editing td {
    background-color: rgba(96,165,250,0.06); /* soft blue tint */
    transition: background-color 0.15s ease-in-out;
}
.sheet tr.editing td:first-child {
    border-left: 4px solid var(--brand-accent);
}
.sheet tr.editing input.form-control {
    border-color: rgba(37,99,235,0.55) !important;
    box-shadow: 0 4px 10px rgba(37,99,235,0.06) !important;
    background: #fff !important;
    padding: 4px 6px !important;
    height: 30px !important;
}
.sheet tr.editing .btn.save-entry { background: var(--brand-primary) !important; color: #fff !important; }
.sheet tr.editing .btn.cancel-entry { background: transparent !important; border-color: var(--border-color) !important; color: var(--text-primary) !important; }

/* small popup menu for 'more' buttons */
.more-menu {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 6px;
    padding: 6px 4px;
    z-index: 1200;
    min-width: 120px;
}
.more-menu .more-item { display: block; padding: 6px 10px; color: var(--text-primary); text-decoration: none; cursor: pointer; }
.more-menu .more-item:hover { background: var(--bg-secondary); }

.main-content .bulk-actions-bar.show,
#bulkActionsBar.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.main-content .bulk-actions-bar .btn {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.88rem !important;
    border-radius: 999px !important;
    min-width: 36px !important;
    height: 36px !important;
}

.main-content .bulk-actions-bar .btn .btn-label { display: inline-block !important; margin-left: 0.35rem !important; }

@media (max-width: 900px) {
    .main-content .bulk-actions-bar { padding: 0.35rem 0.5rem !important; gap: 0.4rem !important; }
    .main-content .bulk-actions-bar .btn { padding: 0.35rem 0.45rem !important; }
    .main-content .bulk-actions-bar .btn .btn-label { display: none !important; }
}

/* Ensure highly specific hover/outline variant on dark backgrounds */
.main-content .bulk-actions-bar .btn-outline--on-dark {
    background: rgba(255,255,255,0.08) !important;
    color: var(--text-on-primary) !important;
    border-color: rgba(255,255,255,0.12) !important;
}

    /* Special case: when the bulk bar is wrapped inside an outer fixed container (#floatingActions),
       the inner bar must be positioned statically to avoid nested fixed transforms and overflow. */
    #floatingActions .bulk-actions-bar,
    #floatingBar .bulk-actions-bar {
        position: static !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
        max-width: 100% !important;
        overflow: visible !important;
        display: flex !important;
    }

    /* Ensure labels visibility handled by responsive rules when inside floating container */
    #floatingActions .bulk-actions-bar .btn .btn-label,
    #floatingBar .bulk-actions-bar .btn .btn-label {
        display: none !important;
    }
    @media (min-width: 900px) {
        #floatingActions .bulk-actions-bar .btn .btn-label,
        #floatingBar .bulk-actions-bar .btn .btn-label { display: inline-block !important; }
    }

    /* Fix for expired_files: force single-line layout, allow left text to shrink with ellipsis,
       and ensure the button group stays inline so the bar does not occupy two lines. */
    #floatingActions .bulk-actions-bar,
    #floatingBar .bulk-actions-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    #floatingActions .bulk-actions-bar > span,
    #floatingActions .bulk-actions-bar > a,
    #floatingBar .bulk-actions-bar > span,
    #floatingBar .bulk-actions-bar > a {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 34% !important;
        display: inline-block !important;
    }

    #floatingActions .bulk-actions-bar > div,
    #floatingBar .bulk-actions-bar > div {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        gap: 0.35rem !important;
    }

    /* Hide the "select all results" link on very small screens to guarantee single-line */
    @media (max-width: 520px) {
        #floatingActions .bulk-actions-bar > a#floatingSelectAllResults,
        #floatingBar .bulk-actions-bar > a#floatingSelectAllResults { display: none !important; }
        #floatingActions .bulk-actions-bar > span,
        #floatingBar .bulk-actions-bar > span { max-width: 46% !important; }
    }

    /* ICONS ONLY: hide button labels inside the floatingActions/floatingBar to show icons only */
    #floatingActions .bulk-actions-bar .btn .btn-label,
    #floatingBar .bulk-actions-bar .btn .btn-label {
        display: none !important;
    }

    /* Slightly tighten button padding for icon-only presentation */
    #floatingActions .bulk-actions-bar .btn,
    #floatingBar .bulk-actions-bar .btn {
        padding: 0.35rem 0.45rem !important;
    }

    /* Show numeric counter, hide duplicate textual helpers (label, badge, select-all link) */
    #floatingActions .bulk-actions-bar > span#bulkSelectedCount,
    #floatingBar .bulk-actions-bar > span#bulkSelectedCount {
        display: inline-block !important;
        margin-right: 0.4rem !important;
    }

    /* Show the textual label next to the numeric counter by default (compact styling).
       JS will still hide it when 'select all results' is active. */
    #floatingActions .bulk-actions-bar > span#bulkSelectedLabel,
    #floatingBar .bulk-actions-bar > span#bulkSelectedLabel {
        display: inline-block !important;
        margin-left: 0.35rem !important;
        color: var(--text-on-primary) !important;
        opacity: 0.95 !important;
        font-weight: 500 !important;
    }

    #floatingActions .bulk-actions-bar > span#selectedAllBadge,
    #floatingActions .bulk-actions-bar > a#floatingSelectAllResults,
    #floatingBar .bulk-actions-bar > span#selectedAllBadge,
    #floatingBar .bulk-actions-bar > a#floatingSelectAllResults {
        /* keep badge and select-all link hidden to avoid duplication when JS shows the blue badge */
        display: none !important;
    }

    /* Slightly tighten overall padding when textual helpers are hidden */
    #floatingActions .bulk-actions-bar,
    #floatingBar .bulk-actions-bar {
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }

/* Ensure period selector buttons inside brand headers are readable */
.card-header .period-btn {
    padding: 0.42rem 0.9rem;
    border: 1px solid var(--period-border);
    background: var(--period-bg);
    color: var(--period-text);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.card-header .period-btn:hover {
    background: color-mix(in srgb, var(--period-bg) 88%, black 12%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.card-header .period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
}

/* Fallback for period buttons outside headers */
.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.period-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-on-primary);
}
.period-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-color); }
.form-label.required::after { content: " *"; color: var(--danger-color); }
.form-control { width: 100%; padding: 0.625rem 0.875rem; font-size: 0.875rem; border: 1.5px solid rgba(0, 0, 0, 0.15); border-radius: var(--radius-md); background-color: rgba(255, 255, 255, 0.05); color: var(--text-color); transition: all 0.2s; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); }
.form-control:hover { border-color: rgba(0, 0, 0, 0.25); background-color: rgba(255, 255, 255, 0.08); }
.form-control:focus { outline: none; border-color: var(--primary-color); background-color: var(--surface-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.05); }
.form-control:disabled { background-color: var(--bg-color); opacity: 0.6; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; padding-right: 2.5rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; cursor: pointer; }
.form-text { display: block; margin-top: 0.25rem; font-size: 0.8125rem; color: var(--text-muted); }
.form-error { color: var(--danger-color); font-size: 0.8125rem; margin-top: 0.25rem; }

/* ===== Tables ===== */
.table-responsive { overflow: visible; }

@media (max-width: 1100px) {
    .table-responsive { overflow-x: auto; }
}
.table { width: 100%; border-collapse: collapse; }
.table thead th { background-color: var(--bg-color); padding: 0.875rem 1rem; text-align: left; font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; border-bottom: 2px solid var(--border-color); }
.table tbody td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-color); }
.table tbody tr:hover { background-color: var(--bg-color); }
.table tbody tr.selected { background-color: rgba(37, 99, 235, 0.05); }

/* ===== Alerts ===== */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); border: 1px solid transparent; margin-bottom: 1rem; }
.alert-success { background-color: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger { background-color: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background-color: #fef3c7; border-color: #fcd34d; color: #92400e; }
.alert-info { background-color: #dbeafe; border-color: #93c5fd; color: #1e40af; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.75rem; font-weight: 500; border-radius: 9999px; }
.badge-primary { background-color: #dbeafe; color: #1e40af; }
.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-secondary { background-color: #f1f5f9; color: #475569; }

/* ===== Modals ===== */
/* (legacy .modal styles removed; project uses .modal-overlay + .modal-dialog block at the end) */

/* ===== Login Page ===== */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background-image: url('images/background-clocks.svg'); background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; background-color: #0f1724; }
.login-card { background-color: rgba(255,255,255,0.98); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); backdrop-filter: blur(10px); border: 1px solid rgba(0,0,0,0.1); }
.login-card h2 { color: #1a1a1a; }
.login-card .form-label { color: #333; }
.login-card .alert { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header .logo { justify-content: center; margin-bottom: 1rem; }
.login-header h1 { font-size: 1.5rem; margin-bottom: 0.5rem; color: #1a1a1a; }
.login-header p { color: #666; }

/* ===== Footer ===== */
.footer { 
  position: fixed; 
  bottom: 0; 
  left: 0; 
  right: 0; 
  width: 100%;
  padding: 0.15rem 0.5rem; 
  border-top: 1px solid var(--border-color); 
  background-color: var(--surface-color); 
  text-align: center; 
  font-size: 0.65rem;
  line-height: 1;
  height: auto;
  z-index: 100;
}
.footer .container { padding: 0 !important; margin: 0 !important; max-width: none !important; }
.footer-links { display: none; }
.footer-copyright { margin: 0; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: block; }
    .table { font-size: 0.8125rem; }
    .table thead th, .table tbody td { padding: 0.5rem; }
}

@media (min-width: 769px) {
    .mobile-menu-toggle { display: none; }
}

/* ===== Loading ===== */
.spinner { border: 3px solid var(--border-color); border-top: 3px solid var(--primary-color); border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Font Awesome Icon Styles */
.fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
}

.menu-item i.fas {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.5rem;
}

.btn i.fas {
    margin-right: 0.25rem;
}

.stat-icon-modern i.fas {
    font-size: inherit;
}

.admin-stat-icon i.fas {
    font-size: inherit;
}

.quick-action-icon i.fas {
    font-size: inherit;
}

/* App-specific overrides to integrate Mimir with existing `.sheet` styles */
/* Keep this block at the end so it overrides upstream rules */
.main-content .container { padding: 1.5rem; max-width: 1100px; margin: 1rem auto; padding-bottom: 1.5rem; /* Espacio para el footer fijo */ }

/* Hours register and dashboard need more horizontal room (wide tables) */
.page-index .main-content .container,
.page-dashboard .main-content .container { max-width: none !important; width: 75% !important; }
.page-dashboard .container { max-width: none !important; width: 75% !important; }
.page-index .table-responsive { overflow: visible; }
.app-container { display: flex; }
body { display: flex; flex-direction: column; }

/* Align month summary with month toggle indent */
.page-index .month-summary-row { padding-left: 42px; }

/* Keep month summary clearly separated from next month */
.sheet tr.month-summary td { border-bottom: 2px solid var(--border-color); }

/* Sticky month column headers: avoid clipped text on first paint */
.sheet tr.month-columns th { line-height: 1.2; vertical-align: middle; background: var(--bg-color); }

/* Make .sheet look more like the theme's tables */
/* NOTE: keep overflow visible + border-collapse separate so sticky headers work in Chrome */
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 8px; overflow: visible; }
.sheet thead th { background-color: var(--bg-color); padding: 0.85rem 1rem; text-align: left; font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border-color); }
.sheet tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.sheet tbody tr:hover { background-color: var(--bg-secondary); }
.sheet.compact thead th, .sheet.compact tbody td { padding: 0.5rem 0.75rem; font-size: 13px; }

/* Floating month column headers: fixed position when scrolling over table */
.page-index .table-responsive { position: relative; }
.sheet tr.month-columns { opacity: 1; transition: opacity 0.1s; }
.sheet tr.month-columns th { background: var(--bg-color); padding: 0.5rem 0.75rem; text-align: left; font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border-color); }
.sheet tr.month-columns { position: sticky; top: 60px; z-index: 99; background: var(--bg-secondary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.sheet td.month-header { position: relative; z-index: 30; background: var(--bg-secondary); box-shadow: 0 1px 0 var(--border-color); }

/* Schedule balance cells (coffee/lunch): color by sign vs configured minutes */
.sheet td.balance-cell { font-weight: 700; }
.sheet td.balance-cell.balance--good { color: var(--success-color); box-shadow: inset 3px 0 0 var(--success-color); }
.sheet td.balance-cell.balance--bad { color: var(--danger-color); box-shadow: inset 3px 0 0 var(--danger-color); }
.sheet td.balance-cell.balance--ok { color: var(--text-secondary); }
.sheet td.balance-cell.balance--missing { color: var(--text-muted); font-weight: 600; }

/* Pills (compact badges with icon) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; font-weight: 700; font-size: 12px; line-height: 18px; white-space: nowrap; background: var(--bg-color); }
.pill .pill-icon { font-weight: 900; width: 1em; text-align: center; }
.pill.balance--good { color: var(--success-color); }
.pill.balance--bad { color: var(--danger-color); }
.pill.balance--ok { color: var(--text-secondary); }
.pill.balance--missing { color: var(--text-muted); }

/* Month summary row */
.sheet tr.month-summary td { 
  background: #eff6ff !important;
  border-top: 2px solid #3b82f6 !important;
  border-bottom: 2px solid #3b82f6 !important;
  padding: 10px 12px !important;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}
.sheet tr.month-summary {
  background: #eff6ff !important;
}
.month-summary-row { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 12px; 
  align-items: center;
  padding: 2px 0;
}
.month-summary-title { 
  font-weight: 700; 
  color: #1e40af !important;
  margin-right: 12px;
  font-size: 1.05em;
}
.month-summary-meta { 
  color: #3b82f6 !important; 
  font-weight: 600; 
  font-size: 13px; 
  margin-left: auto;
}
@media (max-width: 900px){
    .month-summary-meta { width: 100%; margin-left: 0; }
}

/* Week summary row */
.sheet tr.week-summary td { background: rgba(229, 231, 235, 0.5); border-top: 2px solid var(--border-color); border-bottom: 2px solid var(--border-color); }
.week-summary-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 0; }
.week-summary-title { font-weight: 700; color: var(--text-secondary); margin-right: 8px; font-size: 13px; }
@media (max-width: 900px){
    .week-summary-row { flex-direction: column; align-items: flex-start; }
    .week-summary-title { width: 100%; }
}

/* Make month rows stand out */
.sheet tr.month td { 
  background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%) !important;
  font-weight: 700 !important; 
  text-transform: uppercase;
  color: #1e40af !important;
  padding: 11px 14px !important;
  border-top: 2px solid #3b82f6 !important;
  border-bottom: none !important;
  border-left: 2px solid #3b82f6 !important;
  border-right: 2px solid #3b82f6 !important;
  box-shadow: none !important;
  cursor: pointer;
  letter-spacing: 0.5px;
  font-size: 0.95em;
}
.sheet tr.month {
  background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%) !important;
}
.sheet tr.month:hover td {
  background: linear-gradient(90deg, #bfdbfe 0%, #dbeafe 100%) !important;
  box-shadow: none !important;
}

/* Remove bottom border from month header and top border from columns header */
.sheet tr.month td { border-bottom: none !important; }
.sheet tr.month-columns th { 
  border-top: none !important;
}

/* Border sides for month group rows - REMOVED, too cluttered */

/* Month summary closing the rectangle */
.sheet tr.month-summary td {
  border-bottom: 2px solid #3b82f6 !important;
}

/* Form layout improvements for inline forms */
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-form .form-group, .row-form .field { flex: 1 1 200px; min-width: 160px; }
.row-form label { display: block; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 6px; }
.form-control { width: 100%; }

/* Keep inline/toolbar forms tight */
form.row-form { margin: 0; }

/* Keep table action forms from adding vertical whitespace */
.table td form, .sheet td form { margin: 0; display: inline; }

/* Global form styles */
.form-wrapper { background: var(--surface-color); border: 1px solid var(--border-color); padding: 18px; border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid.single-column { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin: 0; }
label.form-label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 600; color: var(--text-primary); }
.form-label { font-weight: 600; color: var(--text-primary); }
.form-help { font-size: 12px; color: var(--text-muted); }
.form-control, .form-select, .form-textarea { background: var(--bg-color); border: 1px solid var(--border-color); padding: 8px 10px; border-radius: 6px; color: var(--text-primary); min-height: 36px; }
.form-control::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.form-textarea { min-height: 90px; resize: vertical; }
.form-actions { display:flex; gap:8px; align-items:center; }
.btn:disabled, .btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Checkbox / radio modern look */
.form-check { display:flex; align-items:center; gap:8px; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width:16px; height:16px; }

/* Inline small form compacting */
@media (max-width:900px){ .form-grid { grid-template-columns: 1fr; } }

/* Config form specific tweaks: give it a subtle card look */
.config-card { padding: 14px; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); border: 1px solid var(--border-color); }

/* Error / validation state */
.field-error { border-color: var(--danger-color) !important; }
.form-error { color: var(--danger-color); font-size: 12px; margin-top: 6px; }

/* Small utility */
.muted { color: var(--text-muted); font-size: 12px; }

/* Buttons */
.actions .btn { min-width: 120px; }
.actions { display: flex; gap: 10px; align-items: center; }

/* Login page button styling */
.login-card .actions { display: flex; justify-content: center; margin-top: 2rem; }
.login-card .actions .btn { width: 100%; max-width: 100%; }

/* Badges slightly larger for calendar view */
.badge { font-size: 0.78rem; padding: 0.3rem 0.6rem; }

/* Make footer subtle and aligned - DEPRECATED (usando footer fijo ahora) */

/* Small responsive tweak for narrow screens */
@media (max-width: 720px) {
    .row-form { flex-direction: column; }
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  background: rgba(255,255,255,0.98);
  border: 2px solid #3742fa;
  font-size: 1.8rem;
  cursor: pointer;
  color: #3742fa;
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.2s;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-weight: bold;
}

.mobile-menu-toggle:hover {
  background: rgba(255,255,255,1);
  border-color: #1e40af;
  transform: scale(1.1);
}

#mobileMenuOpen {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 999;
}

#mobileMenuClose {
  background: transparent;
  padding: 0.5rem 0.75rem;
}

/* Mobile responsive: show/hide hamburger menu */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }
  
  /* Desktop topbar layout turns into vertical sidebar on mobile */
  .app-container { flex-direction: column; }
  .header {
    position: relative;
  }
  
  .sidebar { 
    position: fixed;
    left: 0;
    top: 0;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 215;
    display: flex;
    flex-direction: column;
    background: #1a2847;
    border-right: 1px solid rgba(255,255,255,0.1);
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  }
  
  .sidebar::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: -1;
  }
  
  .sidebar.open::after {
    opacity: 1;
    pointer-events: all;
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-header .sidebar-brand-visual {
    flex: 1;
    padding: 0;
    margin: 0;
  }
  
  .sidebar-header .logo h1 {
    font-size: 1.1rem;
    margin: 0;
  }
  
  .sidebar-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-y: auto;
    flex: 1;
  }
  
  .menu-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
    margin: 0;
  }
  
  .menu-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    color: #b8d3ff;
    text-decoration: none;
    display: flex;
    align-items: center;
  }
  
  .menu-item:hover {
    background-color: rgba(255,255,255,0.15);
    color: #ffffff;
  }
  
  .menu-item.active {
    background-color: #3742fa;
    color: white;
  }
  
  .menu-user {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
  }
  
  .menu-user-dropdown {
    position: static;
    display: none;
    background: var(--bg-color);
    border: none;
    box-shadow: none;
    top: auto;
    right: auto;
    min-width: auto;
  }
  
  .menu-user.open .menu-user-dropdown {
    display: block;
  }
  
  .dropdown-item {
    padding: 0.5rem 1rem 0.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .main-content {
    position: relative;
  }
}

/* ===== Modal (reusable) ===== */
.modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}
.modal-dialog{
    width: min(980px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Modal compacto para festivos - dentro del contenedor */
.modal-overlay-compact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    inset: 0;
}
.modal-dialog-compact {
    width: min(420px, 95%);
    max-height: 80vh;
    overflow-y: auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* Modal compacto para festivos - centrado pero pequeño (alternativa fija) */
.modal-overlay.compact-modal {
    align-items: center;
    justify-content: center;
}
.modal-overlay.compact-modal .modal-dialog {
    width: min(420px, 95%);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header{
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}
.modal-title{ margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.modal-body{ padding: 14px 16px; }
.modal-actions{ gap: 10px; justify-content: flex-end; width: 100%; }

@media (max-width: 720px){
    .modal-dialog{ width: 100%; }
}


/* Custom tweaks: compact inline entry form widths and responsive behavior */
.row-form label { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.row-form .form-label { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; }
.row-form label input { width: 120px; padding: 6px 8px; }
.row-form label select { width: 150px; padding: 6px 8px; }
.row-form label input[type="date"] { width: 150px; }
.row-form label input[type="text"] { min-width: 220px; }
.row-form label input.time-input { width: 92px; min-width: 92px; }
.entry-form input[name="note"] { min-width: 150px; }

/* ===== Dashboard layout helpers (replace inline styles) ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.week-cards {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.dashboard-split-cards {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.dashboard-mini-card {
    padding: 8px;
}

.dashboard-mini-card--half {
    flex: 1 1 50%;
    min-width: 0;
}

.dashboard-note {
    margin-top: 6px;
}

.dashboard-value {
    font-size: 1.4rem;
    font-weight: 800;
}

.dashboard-value--sm {
    font-size: 1.2rem;
}

.dashboard-section-title {
    margin-top: 18px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Sparklines: use theme accent via currentColor */
.sparkline { color: var(--accent-color); }
.sparkline-svg { display: block; width: 100%; height: 100%; }
.row-form .actions { margin: 0 0 0 6px; }
.row-form { gap: 10px; }
@media (max-width: 900px) {
    .row-form { flex-direction: column; align-items: stretch; }
    .row-form label { width: 100%; justify-content: space-between; }
    .row-form label input { width: 60%; }
    .row-form label input[type="text"] { width: 100%; }
    .row-form .actions { margin-top: 8px; }
}

/* ===== Buttons (unified polish) =====
   Many templates use either `.btn btn-primary` or just `.btn-primary`.
   This block standardizes all button-like elements at the end of the file.
*/
.btn,
button.btn-primary, button.btn-secondary, button.btn-danger, button.btn-success, button.btn-warning, button.btn-outline,
a.btn-primary, a.btn-secondary, a.btn-danger, a.btn-success, a.btn-warning, a.btn-outline,
input[type="submit"].btn-primary, input[type="submit"].btn-secondary, input[type="submit"].btn-danger,
input[type="submit"].btn-success, input[type="submit"].btn-warning, input[type="submit"].btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 8px 12px;
    min-height: 36px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn:hover,
button.btn-primary:hover, button.btn-secondary:hover, button.btn-danger:hover, button.btn-success:hover, button.btn-warning:hover, button.btn-outline:hover,
a.btn-primary:hover, a.btn-secondary:hover, a.btn-danger:hover, a.btn-success:hover, a.btn-warning:hover, a.btn-outline:hover {
    transform: translateY(-1px);
}

.btn:active,
button.btn-primary:active, button.btn-secondary:active, button.btn-danger:active, button.btn-success:active, button.btn-warning:active, button.btn-outline:active,
a.btn-primary:active, a.btn-secondary:active, a.btn-danger:active, a.btn-success:active, a.btn-warning:active, a.btn-outline:active {
    transform: translateY(0);
}

.btn:focus-visible,
button.btn-primary:focus-visible, button.btn-secondary:focus-visible, button.btn-danger:focus-visible,
button.btn-success:focus-visible, button.btn-warning:focus-visible, button.btn-outline:focus-visible,
a.btn-primary:focus-visible, a.btn-secondary:focus-visible, a.btn-danger:focus-visible,
a.btn-success:focus-visible, a.btn-warning:focus-visible, a.btn-outline:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.12);
}

.btn:disabled,
button.btn-primary:disabled, button.btn-secondary:disabled, button.btn-danger:disabled,
button.btn-success:disabled, button.btn-warning:disabled, button.btn-outline:disabled,
input[type="submit"].btn-primary:disabled, input[type="submit"].btn-secondary:disabled,
input[type="submit"].btn-danger:disabled, input[type="submit"].btn-success:disabled,
input[type="submit"].btn-warning:disabled, input[type="submit"].btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Default `.btn` (no variant) behaves like an outline button */
.btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg-secondary); box-shadow: var(--shadow-md); }

/* Variant buttons */
button.btn-primary, a.btn-primary, input[type="submit"].btn-primary,
.btn.btn-primary {
    background: var(--primary-color) !important;
    color: var(--text-on-primary) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-sm);
}
button.btn-primary:hover, a.btn-primary:hover, .btn.btn-primary:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }

button.btn-secondary, a.btn-secondary, input[type="submit"].btn-secondary,
.btn.btn-secondary {
    background: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    box-shadow: none;
}
button.btn-secondary:hover, a.btn-secondary:hover, .btn.btn-secondary:hover { background: var(--bg-secondary) !important; box-shadow: none; }

button.btn-danger, a.btn-danger, input[type="submit"].btn-danger,
.btn.btn-danger {
    background: var(--danger-color) !important;
    color: var(--text-on-primary) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-sm);
}
button.btn-danger:hover, a.btn-danger:hover, .btn.btn-danger:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }

button.btn-success, a.btn-success, input[type="submit"].btn-success,
.btn.btn-success {
    background: var(--success-color) !important;
    color: var(--text-on-primary) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-sm);
}
button.btn-success:hover, a.btn-success:hover, .btn.btn-success:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }

button.btn-warning, a.btn-warning, input[type="submit"].btn-warning,
.btn.btn-warning {
    background: var(--warning-color) !important;
    color: var(--text-on-primary) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-sm);
}
button.btn-warning:hover, a.btn-warning:hover, .btn.btn-warning:hover { filter: brightness(0.96); box-shadow: var(--shadow-md); }

button.btn-outline, a.btn-outline, input[type="submit"].btn-outline,
.btn.btn-outline {
    background: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    box-shadow: none;
}
button.btn-outline:hover, a.btn-outline:hover, .btn.btn-outline:hover { background: var(--bg-secondary) !important; }

/* Edit icon button variant (used in settings tables) */
.btn-edit {
    background: var(--warning-color) !important;
    color: var(--text-on-primary) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-sm) !important;
}
.btn-edit:hover { filter: brightness(0.96); box-shadow: var(--shadow-md) !important; }
.btn-edit svg { width: 16px; height: 16px; }

/* Month toggle button inside month header */
.sheet tr.month td { position: relative; }
.sheet td.month-header { cursor: pointer; }
.month-toggle {
    display: inline-block;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1.4rem;
    text-align: center;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    border-radius: 4px;
    margin-right: 8px;
    cursor: pointer;
    font-weight: 700;
}
.month-toggle, .sheet td.month-header { user-select: none; }

/* Debug indicator */
#month-debug { position: fixed; right: 12px; bottom: 12px; background: rgba(0,0,0,0.7); color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 12px; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
#month-debug.hidden { display: none; }
.month-toggle:focus { outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

/* Collapsed month: hide all rows except the header + summary */
tbody.month-group.collapsed tr:not(.month):not(.month-summary) { display: none; }
tbody.month-group .month-header.collapsed { opacity: 0.85; }

/* Weekend highlight */
.sheet tbody tr.weekend td {
    background-color: rgba(250, 240, 210, 0.55); /* warm subtle highlight */
}

/* Add a weekend icon in the first cell */
.sheet tbody tr.weekend td:first-child {
    position: relative;
    padding-left: 28px; /* space for icon */
}
.sheet tbody tr.weekend td:first-child::before {
    content: "🌙";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.9;
}

/* Slightly dim weekend header color to differentiate */
tbody.month-group.collapsed tr.weekend td:not(.month) { opacity: 0.95; }

/* Holiday highlight (general) */
.sheet tbody tr.holiday td {
    background-color: rgba(255, 230, 230, 0.8); /* light red/pink */
}
.sheet tbody tr.holiday td:first-child {
    position: relative;
    padding-left: 28px;
}
.sheet tbody tr.holiday td:first-child::before {
    content: "🎉";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.95;
}

/* Vacation highlight */
.sheet tbody tr.vacation td { background-color: rgba(230, 245, 255, 0.85); }
.sheet tbody tr.personal td { background-color: rgba(235, 255, 230, 0.85); }
.sheet tbody tr.illness td { background-color: rgba(255, 250, 230, 0.85); }
.sheet tbody tr.permiso td { background-color: rgba(240, 245, 255, 0.85); }



/* Ensure date column shows fully: give first column more space and avoid truncation */
.sheet th:first-child, .sheet td:first-child {
    min-width: 130px !important;
    white-space: nowrap !important;
}

/* If compact mode is enabled, still allow date to expand */
.page-index.compact .sheet th:first-child, .page-index.compact .sheet td:first-child {
    min-width: 110px !important;
    white-space: nowrap !important;
}

/* Strong overrides to counter earlier compact/fixed-table rules that shrink the first column */
.sheet.compact th:nth-child(1), .sheet.compact td:nth-child(1),
.sheet th:nth-child(1), .sheet td:nth-child(1) {
    min-width: 130px !important;
    max-width: none !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* If the table layout is fixed globally, allow the first column to behave like auto for visibility */
.sheet.compact, .sheet {
    table-layout: auto !important;
}

/* Date cell styling: center weekend labels and keep nowrap */
.sheet td.date-cell, .sheet th.date-cell { white-space: nowrap; }
.sheet td.date-cell.center, .sheet th.date-cell.center {
    text-align: center !important;
    font-weight: 600;
}

/* ===== Holiday Calendar Styling ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.calendar-day-header {
    background: #0f172a;
    color: #fff;
    padding: 8px 4px;
    font-weight: 600;
    text-align: center;
    font-size: 11px;
    border-radius: 3px;
}

.calendar-empty {
    background: #f1f5f9;
    border-radius: 3px;
}

.calendar-day {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 8px 4px;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    transition: all 0.15s ease;
}

.calendar-day:hover {
    background: #f0f9ff;
    border-color: var(--brand-accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-day.today {
    border: 2px solid var(--brand-primary);
    background: #eff6ff;
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--brand-primary);
    color: white;
    border-color: #1e3a8a;
    font-weight: 700;
}

.calendar-day.selected:hover {
    background: #1e3a8a;
    border-color: #172554;
}

.calendar-day.selected.today {
    border: 2px solid #fff;
    box-shadow: inset 0 0 0 2px var(--brand-primary);
}



