/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors - HSL */
    --hue-primary: 220;
    --hue-accent: 210;

    --color-bg-body: hsl(var(--hue-primary), 20%, 97%);
    --color-bg-sidebar: hsl(0, 0%, 100%);
    --color-bg-card: hsl(0, 0%, 100%);

    --color-text-primary: hsl(var(--hue-primary), 40%, 10%);
    --color-text-secondary: hsl(var(--hue-primary), 20%, 40%);
    --color-text-muted: hsl(var(--hue-primary), 10%, 60%);

    --color-primary: hsl(var(--hue-primary), 90%, 10%);
    --color-primary-hover: hsl(var(--hue-primary), 80%, 20%);
    --color-accent: hsl(var(--hue-accent), 100%, 50%);

    --color-border: hsl(var(--hue-primary), 20%, 90%);
    --color-divider: hsl(var(--hue-primary), 20%, 95%);

    --color-success: hsl(150, 80%, 40%);
    --color-success-bg: hsl(150, 80%, 95%);
    --color-warning: hsl(35, 90%, 50%);
    --color-warning-bg: hsl(35, 90%, 95%);
    --color-danger: hsl(0, 80%, 60%);
    --color-danger-bg: hsl(0, 80%, 95%);
    --color-info: hsl(210, 90%, 50%);
    --color-info-bg: hsl(210, 90%, 95%);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-card: 0 0 0 1px rgb(0 0 0 / 0.03), 0 2px 8px rgb(0 0 0 / 0.04);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==================== LAYOUT ==================== */
.app-container {
    display: flex;
    height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background-color: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    flex-shrink: 0;
    transition: var(--transition);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-sm);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    color: var(--color-text-primary);
}

/* ==================== NAVIGATION ==================== */
.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.75rem var(--space-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
}

.nav-item.active {
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 3px;
    background-color: var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: inherit;
}

.nav-item .icon svg {
    width: 20px;
    height: 20px;
}

/* ==================== SIDEBAR FOOTER ==================== */
.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.user-profile:hover {
    background-color: var(--color-bg-body);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4338ca;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 0 0 2px white, 0 0 0 3px var(--color-border);
}

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

.user-info .name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: transparent;
    flex-shrink: 0;
}

.topbar h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.content-area {
    flex: 1;
    padding: 0 var(--space-xl) var(--space-xl);
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 0;
}

/* ==================== BUTTONS ==================== */
.icon-btn {
    background: white;
    border: 1px solid var(--color-border);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: var(--radius-full);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    background-color: white;
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.3);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: white;
    color: var(--color-text-primary);
    border: 2px solid var(--color-border);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-body) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-secondary:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.2);
    outline-offset: 2px;
}

/* ==================== UTILITY CLASSES ==================== */
.card {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.font-bold {
    font-weight: 600;
}

/* ==================== STATUS BADGES ==================== */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge.todo {
    background-color: var(--color-bg-body);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.badge.inprogress {
    background-color: var(--color-info-bg);
    color: var(--color-info);
}

.badge.completed {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

/* ==================== SCHEDULER & CALENDAR STYLES ==================== */
.scheduler-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.scheduler-view .card {
    height: calc(100vh - 120px);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#calendar-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.fc {
    height: 100% !important;
}

.fc-header-toolbar {
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-md) !important;
    flex-shrink: 0;
}

.fc .fc-button {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.fc .fc-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.fc .fc-button:hover::before {
    left: 100%;
}

.fc .fc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.fc .fc-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--color-primary-hover);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fc .fc-button-primary:disabled {
    background: var(--color-bg-body);
    color: var(--color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.fc-theme-standard .fc-scrollgrid {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--color-divider);
}

.fc-col-header-cell {
    padding: 0.5rem 0.375rem;
    background-color: var(--color-bg-body);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.fc-daygrid-day {
    min-height: 50px;
    transition: var(--transition);
}

.fc-daygrid-day:hover {
    background-color: var(--color-bg-body);
}

.fc-daygrid-day-number {
    padding: 0.25rem 0.375rem;
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 0.75rem;
}

.fc-day-today {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

.fc-day-today .fc-daygrid-day-number {
    background-color: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-event {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    box-shadow: var(--shadow-sm) !important;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md) !important;
}

.fc-timegrid-event {
    border-radius: var(--radius-md) !important;
}

/* ==================== MODAL STYLES ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay.fade-out {
    animation: fadeOut 0.2s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.close-modal:hover {
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

/* ==================== FORM STYLES ==================== */
.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.form-input,
select.form-input,
textarea.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: white;
    transition: var(--transition);
}

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

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.color-btn {
    flex-shrink: 0;
}

.color-btn:hover {
    transform: scale(1.1);
}

/* ==================== SCROLLBAR STYLES ==================== */
.content-area::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
    background: var(--color-bg-body);
}

.content-area::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.content-area::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-md);
    }

    .main-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: var(--space-sm);
        gap: var(--space-sm);
    }

    .nav-item {
        white-space: nowrap;
        padding: 0.5rem 1rem;
    }

    .nav-item.active::before {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .topbar {
        height: 60px;
        padding: 0 var(--space-md);
    }

    .topbar h1 {
        font-size: 1.5rem;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}