:root {
    /* Cream & Slate Palette */
    --bg-body: #f5f7fa;
    /* User Requested Grey */
    --bg-sidebar: #f5f7fa;
    /* Match Body */
    --bg-card: #FFFFFF;

    --slate-banner: #537C90;
    /* Muted Blue/Slate */
    --slate-dark: #37474F;
    /* Dark Charcoal/Slate */

    --accent-beige: #F0E2D0;
    /* Sidebar Active Highlight */

    --text-main: #1A2B3C;
    /* Dark Navy */
    --text-muted: #607D8B;
    --red-text: #C62828;

    --border: #EAE0D5;
    /* Subtle beige border */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* GLOBAL RESET */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-main);
    background: var(--bg-body);
}

/* UTILS */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.w-full {
    width: 100%;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* LAYOUT Container */
.container {
    width: 100%;
    height: 100%;
    display: flex;
    background: var(--bg-body);
    padding: 0;
    flex-direction: row;
    /* Sidebar Left, Content Right */
}

/* SIDEBAR - Clean, No Border */
aside {
    width: 260px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0 25px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px;
}

.sidebar-nav a {
    color: var(--text-muted);
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    border-radius: 8px;
    /* Rounded pill style */
    margin-bottom: 5px;
    font-weight: 600;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-nav a.active {
    background: var(--accent-beige);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ccc;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    border-radius: 6px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* MAIN CONTENT AREA */
/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: white;
    border-radius: 12px;
    /* Curved Edges */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    /* For border radius */
    margin-top: 8px;
    animation: fadeIn 0.2s ease;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--slate-dark);
    /* Dark text for white bg */
    background-color: white;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle separator */
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* Hover Flash Effect */
.dropdown-item:hover {
    background-color: #f8f9fa;
    /* Light grey hover */
    padding-left: 25px;
    /* Slide interaction */
    color: var(--slate-banner);
    /* Highlight text color */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 40px 20px 20px;
    /* Right padding for visual balance */
    min-width: 0;
    /* Flex fix */
}

/* HEADER (Title & Controls) */
.main-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.year-sub {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* CALENDAR WRAPPER */
.calendar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 0;
}

/* Banner */
.planner-header {
    background-color: var(--slate-banner);
    color: white;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
}

.month-label {
    font-size: 2.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.year-label {
    font-size: 2.2rem;
    font-weight: 700;
    opacity: 0.9;
}

/* Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: 40px repeat(6, minmax(0, 1fr));
    background: white;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Weekday Row */
.weekday {
    background-color: var(--slate-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.weekday:last-child {
    border-right: none;
}

/* Cells */
.day-cell {
    background: white;
    border-right: 1px solid #F0F0F0;
    /* Very light borders */
    border-bottom: 1px solid #F0F0F0;
    padding: 5px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.day-cell:nth-child(7n) {
    border-right: none;
}

/* Typography */
.num {
    font-size: clamp(1.5rem, 5vh, 2.8rem);
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 5px;
}

/* Holidays */
.holiday-date .num {
    color: var(--red-text);
}

.holiday-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--red-text);
    background: #FFF0F0;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
    margin-top: 3px;
    line-height: 1.2;
    width: 95%;
    /* Allow multi-line to fix stretching */
    white-space: normal;
    word-break: break-word;
}

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 10vh auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: inherit;
}

/* ADMIN STYLES (Added for Grid Editor) */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    padding: 12px;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-default {
    background: #eee;
    color: #666;
}

.admin-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.admin-month-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-month-card h4 {
    margin: 0 0 10px 0;
    text-align: center;
    color: var(--slate-banner);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.admin-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.admin-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s;
}

.admin-day:hover {
    border-color: var(--slate-banner);
    transform: scale(1.05);
}

.admin-day.is-holiday {
    background: #FFEBEE;
    color: var(--red-text);
    border-color: var(--red-text);
    font-weight: bold;
}

.bulk-area {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--bg-body);
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

/* Nav Pill (Next/Prev) */
.nav-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.nav-pill a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 36px;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 1.1rem;
}

.nav-pill a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-pill a:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}