/* ========== CSS Variables ========== */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --dark-color: #1F2937;
    --light-color: #F3F4F6;
    --white: #FFFFFF;
    --gray-100: #F9FAFB;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== Utilities ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.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; }

/* ========== Loading Screen ========== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 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-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}
.btn-secondary:hover { opacity: 0.9; }

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}
.btn-danger:hover { opacity: 0.9; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--gray-600);
}
.btn-icon:hover {
    background: var(--gray-200);
    color: var(--dark-color);
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ========== Login Page ========== */
.page { min-height: 100vh; }

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    padding: 1rem;
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.login-header p {
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.error-message {
    background: #FEE2E2;
    color: var(--danger-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* ========== Dashboard Layout ========== */
#dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-header span {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-info {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-700);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--gray-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

#user-name {
    font-weight: 500;
}

.role-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--primary-color);
    border-radius: 9999px;
    margin-top: 0.25rem;
    display: inline-block;
    width: fit-content;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: var(--gray-700);
    color: var(--white);
}

.nav-menu li a.active {
    border-right: 3px solid var(--primary-color);
}

.nav-menu li a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-700);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-right: 0;
}

.top-bar {
    height: var(--header-height);
    background: var(--white);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    display: none;
}

#page-title {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.content-container {
    padding: 1.5rem;
}

/* ========== Cards ========== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--secondary-color); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); }

.stat-info h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========== Table ========== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* ========== Badge ========== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--secondary-color); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info-color); }

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-container {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--gray-600); }

.modal-content {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: #D1FAE5; color: #065F46; }
.toast.error { background: #FEE2E2; color: #991B1B; }
.toast.warning { background: #FEF3C7; color: #92400E; }
.toast.info { background: #DBEAFE; color: #1E40AF; }

/* ========== Calendar ========== */
.calendar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.calendar-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.calendar-day {
    background: var(--white);
    min-height: 100px;
    padding: 0.5rem;
}

.calendar-day.today {
    background: rgba(79, 70, 229, 0.05);
}

.calendar-day.other-month {
    background: var(--gray-50);
    color: var(--gray-400);
}

.day-number {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.calendar-event {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.cancelled {
    background: var(--gray-400);
    text-decoration: line-through;
}

.calendar-event.holiday {
    background: var(--warning);
    color: var(--gray-900);
}

.calendar-event.vacation {
    background: var(--info);
}

.calendar-event.rep-meeting {
    background: #8b5cf6; /* Purple for representative meetings */
}

.calendar-event.shared-meeting {
    background: #06b6d4; /* Cyan for shared calendar meetings */
}

.calendar-day.blocked-day {
    background: rgba(239, 68, 68, 0.08);
}

.calendar-day.blocked-day .day-number {
    color: var(--danger);
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ========== Time Slots ========== */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.time-slot {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.time-slot:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.time-slot.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.time-slot.unavailable {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-container {
        max-width: 100%;
        margin: 1rem;
    }
}

/* ========== Google Calendar Style ========== */
.gcal-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.gcal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.gcal-header-right, .gcal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gcal-today-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.gcal-today-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.gcal-nav-btns {
    display: flex;
    gap: 0.25rem;
}

.gcal-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gcal-nav-btn:hover {
    background: var(--gray-100);
}

.gcal-title {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    color: var(--gray-700);
}

.gcal-view-btns {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 4px;
}

.gcal-view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.gcal-view-btn:hover {
    color: var(--gray-800);
}

.gcal-view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gcal-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.gcal-filter-btn:hover {
    border-color: var(--primary-color);
}

.gcal-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.gcal-add-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
}

.gcal-add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Main Content */
.gcal-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.gcal-sidebar {
    width: 260px;
    padding: 1rem;
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
    background: var(--gray-50);
}

.gcal-create-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: none;
    background: white;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.gcal-create-btn:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
}

.gcal-create-btn i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Mini Calendar */
.gcal-mini-calendar {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.gcal-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.gcal-mini-header button {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gcal-mini-header button:hover {
    background: var(--gray-100);
}

.gcal-mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.gcal-mini-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.gcal-mini-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.gcal-mini-date:hover {
    background: var(--gray-100);
}

.gcal-mini-today {
    background: var(--primary-color);
    color: white;
}

.gcal-mini-today:hover {
    background: var(--primary-color);
}

.gcal-mini-has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

.gcal-mini-date {
    position: relative;
}

.gcal-mini-empty {
    visibility: hidden;
}

/* Legend */
.gcal-legend {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.gcal-legend-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.gcal-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.gcal-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Summary */
.gcal-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.gcal-summary-item {
    text-align: center;
}

.gcal-summary-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.gcal-summary-item span:last-child {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Calendar Content */
.gcal-content {
    flex: 1;
    overflow: auto;
    padding: 0;
}

/* Month View */
.gcal-month-grid {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gcal-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.gcal-month-day-name {
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.gcal-month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
}

.gcal-day {
    min-height: 100px;
    border-left: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    padding: 0.25rem;
    cursor: pointer;
    transition: background 0.2s;
    overflow: hidden;
}

.gcal-day:hover {
    background: var(--gray-50);
}

.gcal-day-other {
    background: var(--gray-50);
    color: var(--gray-400);
}

.gcal-day-today {
    background: rgba(79, 70, 229, 0.05);
}

.gcal-day-num {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    display: inline-block;
}

.today-circle {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gcal-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gcal-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gcal-event:hover {
    opacity: 0.8;
}

.gcal-event-meeting {
    background: var(--primary-color);
    color: white;
}

.gcal-event-rep {
    background: #8b5cf6;
    color: white;
}

.gcal-event-holiday {
    background: var(--warning-color);
    color: white;
}

.gcal-event-vacation {
    background: var(--info-color);
    color: white;
}

.gcal-event-cancelled {
    background: var(--gray-400);
    text-decoration: line-through;
}

.gcal-event-more {
    font-size: 0.7rem;
    color: var(--gray-500);
    padding: 2px 6px;
}

/* Week View */
.gcal-week-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gcal-week-header {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gcal-time-gutter {
    width: 60px;
    flex-shrink: 0;
}

.gcal-week-day-header {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-left: 1px solid var(--gray-100);
}

.gcal-week-day-today {
    background: rgba(79, 70, 229, 0.05);
}

.gcal-week-day-name {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.gcal-week-day-num {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 0.25rem;
}

.gcal-week-body {
    display: flex;
    flex: 1;
    overflow-y: auto;
}

.gcal-time-slot {
    height: 48px;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: left;
    padding: 0 0.5rem;
    position: relative;
    top: -8px;
}

.gcal-week-day-col {
    flex: 1;
    position: relative;
    border-left: 1px solid var(--gray-100);
}

.gcal-week-day-col-today {
    background: rgba(79, 70, 229, 0.02);
}

.gcal-week-cell {
    height: 48px;
    border-bottom: 1px solid var(--gray-100);
}

.gcal-week-event {
    position: absolute;
    right: 2px;
    left: 2px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    z-index: 5;
}

.gcal-week-event:hover {
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gcal-week-event-allday {
    position: relative;
    margin: 2px;
    top: auto !important;
    height: auto !important;
}

.gcal-week-event-time {
    font-weight: 500;
}

.gcal-week-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Day View */
.gcal-day-grid {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gcal-day-allday {
    display: flex;
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.gcal-day-allday-events {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.gcal-day-allday-event {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.gcal-time-label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: left;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.gcal-day-body {
    flex: 1;
    overflow-y: auto;
}

.gcal-day-row {
    display: flex;
    height: 48px;
    min-height: 48px;
    border-bottom: 1px solid var(--gray-100);
}

.gcal-day-cell {
    flex: 1;
    padding: 0.25rem;
    cursor: pointer;
    position: relative;
}

.gcal-day-cell:hover {
    background: var(--gray-50);
}

.gcal-day-event {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.gcal-day-event:hover {
    opacity: 0.9;
}

.gcal-day-event-time {
    font-size: 0.8rem;
    font-weight: 500;
}

.gcal-day-event-title {
    font-weight: 600;
}

.gcal-day-event-rep {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Day View - Absolute positioned events */
.gcal-day-content {
    position: relative;
}

.gcal-day-events-layer {
    position: absolute;
    top: 0;
    right: 60px; /* Account for time labels */
    left: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.gcal-day-event-absolute {
    position: absolute;
    right: 8px;
    left: 8px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    pointer-events: auto;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-right: 4px solid rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.gcal-day-event-absolute:hover {
    opacity: 0.95;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 10;
}

.gcal-day-event-absolute .gcal-day-event-time {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gcal-day-event-absolute .gcal-day-event-title {
    font-weight: 600;
    font-size: 0.9rem;
    flex-grow: 1;
}

.gcal-day-event-absolute .gcal-day-event-duration {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: auto;
    padding-top: 0.25rem;
}

.gcal-day-event-absolute .gcal-day-event-rep {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.gcal-day-event-absolute.gcal-event-cancelled {
    background: var(--gray-400);
    text-decoration: line-through;
    opacity: 0.7;
}

.gcal-day-event-absolute.gcal-event-rep {
    background: #8b5cf6;
    border-right-color: rgba(139, 92, 246, 0.3);
}

/* Day Modal */
.gcal-day-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.gcal-day-modal.active {
    display: flex;
}

.gcal-day-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.gcal-day-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.gcal-day-modal-header h3 {
    margin: 0;
}

.gcal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gcal-close-btn:hover {
    background: var(--gray-100);
}

.gcal-day-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.gcal-modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gcal-modal-section {
    margin-bottom: 1.5rem;
}

.gcal-modal-section h4 {
    margin: 0 0 0.75rem;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.gcal-modal-event {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--gray-50);
}

.gcal-modal-event-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.gcal-modal-event-time {
    font-weight: 600;
    color: var(--primary-color);
}

.gcal-modal-event-title {
    font-weight: 500;
}

.gcal-modal-event-rep {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.gcal-modal-event-actions {
    display: flex;
    gap: 0.25rem;
}

.gcal-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s;
}

.gcal-icon-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.gcal-icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.gcal-modal-event-cancelled {
    opacity: 0.5;
}

.gcal-modal-event-rep {
    border-right: 3px solid #8b5cf6;
}

.gcal-modal-empty {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
}

.gcal-modal-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Meeting Details */
.meeting-details, .timeoff-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meeting-detail-row, .timeoff-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.meeting-detail-row i, .timeoff-detail-row i {
    width: 20px;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.participants-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.participants-list li {
    padding: 0.25rem 0;
}

.participants-list li i {
    margin-left: 0.5rem;
}

.meeting-actions, .timeoff-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Form improvements */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

/* Drag Selection */
.gcal-drag-selected {
    background: rgba(79, 70, 229, 0.15) !important;
    position: relative;
}

.gcal-drag-indicator {
    position: absolute;
    top: 0;
    left: 4px;
    right: 4px;
    bottom: 0;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    pointer-events: none;
}

.gcal-drag-indicator span {
    font-weight: 600;
    font-size: 0.9rem;
}

.gcal-drag-indicator small {
    opacity: 0.8;
    font-size: 0.75rem;
}

.gcal-day-cell,
.gcal-week-cell {
    user-select: none;
    -webkit-user-select: none;
}

.gcal-day-cell:hover,
.gcal-week-cell:hover {
    background: rgba(79, 70, 229, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .gcal-sidebar {
        display: none;
    }

    .gcal-header {
        flex-direction: column;
        gap: 1rem;
    }

    .gcal-title {
        font-size: 1.1rem;
    }

    .gcal-day {
        min-height: 60px;
    }

    .gcal-event {
        font-size: 0.65rem;
    }
}
