:root {
    --bg-app: #070b16;
    --bg-panel: #0d1426;
    --bg-grid: #0f172a;

    --border-color: #1e293b;
    --border-strong: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;

    --accent: #3b82f6;
    --accent-glow: rgba(59,130,246,0.35);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at top, #0b1224, #05070c 70%);
    color: var(--text-primary);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* =========================
   SYSTEM STATUS (Top Right)
   ========================= */
.status-indicator {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 100;
    display: flex; align-items: center; gap: 10px;
    background: rgba(13, 20, 38, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 0.75rem; color: var(--text-secondary); font-weight: 600;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    transition: background-color 0.3s, box-shadow 0.3s;
}
.status-dot.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.nav-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 10px;
}
.nav-link:hover {
    text-decoration: underline;
}

/* =========================
   LAYOUT
   ========================= */
.content-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    height: 100vh;
}

/* =========================
   SIDEBAR
   ========================= */
#dailyPanel {
    background: linear-gradient(180deg, #0b1224, #070b14);
    border-right: 1px solid var(--border-color);
    padding: 28px;
    display: flex; flex-direction: column; gap: 20px;
    box-shadow: 8px 0 40px rgba(0,0,0,0.6);
    min-height: 0; z-index: 10;
}

.brand-header { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-logo { max-height: 84px; }

.widget-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.glass-panel {
    background: linear-gradient(145deg, #111a34, #0c1225);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.label-tiny { font-size: 0.6rem; letter-spacing: 0.25em; color: var(--text-secondary); font-weight: 800; }
.date-value { font-size: 1.15rem; font-weight: 800; }

.weather-temp { font-size: 2.2rem; font-weight: 900; }
.weather-cond { font-size: 0.7rem; letter-spacing: 0.15em; color: var(--accent); font-weight: 800; margin-bottom: 6px; }

.weather-details { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.weather-sep { color: var(--border-strong); }

.section-title { font-size: 0.65rem; font-weight: 900; letter-spacing: 0.3em; color: var(--text-secondary); }

.job-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.daily-card {
    background: linear-gradient(90deg, #0f172a, transparent);
    border-left: 6px solid; border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.daily-card h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.daily-card p { margin: 0; font-size: 0.75rem; color: var(--text-secondary); }

.forecast-strip {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
    background: #0b1224; border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 12px;
}
.forecast-day { text-align: center; }
.f-day-name { font-size: 0.6rem; font-weight: 800; color: var(--text-secondary); }
.f-icon { font-size: 1.4rem; }
.f-temp { font-size: 0.9rem; font-weight: 800; }
.f-details { font-size: 0.6rem; color: var(--text-dim); margin-top: 3px; font-weight: 600; line-height: 1.3;}

/* =========================
   CALENDAR
   ========================= */
#calendarContainer {
    padding: 28px;
    display: flex; flex-direction: column;
    height: 100vh; min-height: 0;
}

/* HEADER WITH CLOCK */
#calendarHeader {
    display: grid;
    /* Left (Clock), Center (Title), Right (Spacer) */
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    margin-bottom: 18px;
    flex: 0 0 auto;
}

/* Digital Clock Style */
.header-clock {
    font-family: 'Inter', monospace;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

#monthLabel {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-align: center;
    white-space: nowrap;
}

/* Spacer/Nav area */
.header-spacer { display: flex; justify-content: flex-end; }

/* Weekdays */
.weekday-header {
    display: grid; grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px; flex: 0 0 auto;
}
.weekday-header div {
    text-align: center; font-weight: 900; letter-spacing: 0.2em;
    font-size: 0.75rem; color: var(--text-secondary);
}

/* Grid */
#calendarGrid {
    flex: 1 1 auto; min-height: 0;
    display: grid; grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    background: #0b1224; border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
}

.day-cell {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 4px; position: relative;
    display: flex; flex-direction: column;
    min-height: 0; overflow: hidden;
}
.day-cell:nth-child(7n) { border-right: none; }
.day-cell:nth-last-child(-n+7) { border-bottom: none; }
.day-cell.other-month { background: #060a14; opacity: 0.6; }

.day-cell.today::before {
    content: ""; position: absolute;
    top: 8px; left: 8px; width: 18px; height: 18px;
    border-radius: 50%; box-shadow: 0 0 0 6px rgba(59,130,246,0.25); z-index: 15;
}
.day-cell.today::after {
    content: ""; position: absolute;
    top: 11px; left: 11px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 10px rgba(59,130,246,0.9); z-index: 16;
}

.day-number {
    text-align: right; font-weight: 800; color: var(--text-primary);
    margin-bottom: 4px; flex: 0 0 auto;
}

.event {
    height: 28px; line-height: 28px; font-size: 0.8rem; font-weight: 800;
    color: white; padding: 0 10px; margin-bottom: 4px;
    border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    position: relative; z-index: 5; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto;
}

.event.is-start { margin-left: 6px; margin-right: -6px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.event.is-middle { margin-left: -6px; margin-right: -6px; border-radius: 0; color: transparent; }
.event.is-end { margin-left: -6px; margin-right: 6px; border-top-left-radius: 0; border-bottom-left-radius: 0; color: transparent; }
.event.is-single { margin-left: 6px; margin-right: 6px; border-radius: 10px; }

.day-type-badge {
    position: absolute; top: 6px;
    background: #1e293b; border: 1px solid var(--border-strong);
    color: white; font-weight: 900; font-size: 0.7rem;
    width: 24px; height: 24px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; z-index: 20;
}