/* ROOT VARIABLES */
:root {
    --primary-color: #4338ca;
    /* Indigo 700 */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --secondary-color: #64748b;
    /* Slate 500 */
    --success-color: #10b981;
    /* Emerald 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --danger-color: #ef4444;
    /* Red 500 */
    --info-color: #3b82f6;
    /* Blue 500 */

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */

    --border-color: #e2e8f0;
    /* Slate 200 */
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 4px 14px 0 rgba(99, 102, 241, 0.39);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* GLOBAL STYLES */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-main);
}

/* NAVBAR */
/* NAVBAR - Professional Light */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.no-caret::after {
    display: none !important;
}

.tracking-tight {
    letter-spacing: -0.035em;
}

.fs-9 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 0.35em 0.8em;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b !important;
    /* Slate 500 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.04);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.08);
    /* Indigo-ish tint */
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* BUTTONS */
.btn-primary-gradient {
    background: var(--primary-gradient);
    color: white;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary-gradient:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
    color: white;
}

.btn-white {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-white:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.hover-primary:hover i {
    color: var(--primary-color);
}

.active-tab {
    background: #eff6ff;
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* CALENDAR GRID */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f5f9;
    /* Slate 100 */
    border-bottom: 1px solid var(--border-color);
}

.calendar-header div {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 0.75rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* auto-rows: minmax(150px, auto); Removed fixed min-height for flex approach in JS if needed, but grid usually needs it */
    background: var(--border-color);
    /* Acts as border lines */
    gap: 1px;
    /* Gap creates the border lines */
    border-bottom: 1px solid var(--border-color);
}

.calendar-cell {
    background: var(--bg-surface);
    min-height: 180px;
    /* Taller cells */
    padding: 0.5rem;
    transition: background 0.2s;
    position: relative;
}

.calendar-cell:hover {
    background: #fafafa;
}

.date-number {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: inline-block;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
}

.calendar-cell.today .date-number {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.4);
}

/* EVENTS */
.event-card {
    font-size: 0.75rem;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: #f3f4f6;
    border-left: 3px solid #ccc;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
    z-index: 10;
    position: relative;
}

/* Event Variants */
.event-blue {
    background: #eff6ff;
    /* Blue 50 */
    color: #1e40af;
    /* Blue 800 */
    border-left-color: #3b82f6;
    /* Blue 500 */
}

.event-indigo {
    background: #eef2ff;
    color: #3730a3;
    border-left-color: #6366f1;
}

.event-orange {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.event-green {
    background: #ecfdf5;
    color: #065f46;
    border-left-color: #10b981;
}

.event-time {
    font-weight: 700;
    opacity: 0.8;
    font-size: 0.7rem;
    min-width: 35px;
}

.text-dark-blue {
    color: #0f172a;
}

/* MOBILE FAB */
.fab-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .calendar-header {
        display: none;
        /* Hide header names on mobile, use simple view */
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendar-cell {
        min-height: auto;
        border-bottom: 1px solid var(--border-color);
    }

    .date-number {
        margin-bottom: 0.25rem;
    }
}

/* MODAL STYLES */
.modal-content {
    border: none;
    box-shadow: var(--shadow-lg);
}

.bg-white-20 {
    background-color: rgba(255, 255, 255, 0.2);
}

.bg-slate-50 {
    background-color: #f8fafc;
}

.fs-7 {
    font-size: 0.85rem !important;
}

.fs-8 {
    font-size: 0.75rem !important;
}

.mw-150px {
    max-width: 150px;
}

/* AVATAR */
.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CUSTOM TABLE */
.custom-table thead th {
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background-color: #f1f5f9;
}

.custom-table tbody tr {
    transition: background-color 0.2s;
}

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

.custom-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td:first-child {
    padding-left: 1rem;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.custom-table td:last-child {
    padding-right: 1rem;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* FORM CONTROLS IN MODAL */
.form-control-sm,
.form-select-sm {
    border-radius: 0.5rem;
    border-color: var(--border-color);
    padding: 0.5rem 0.75rem;
    min-height: 38px;
    /* Force consistent height */
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    margin-bottom: 0.35rem;
}