:root {
    --primary: #0284c7;
    /* Clinical Sky Blue */
    --primary-hover: #0369a1;
    --secondary: #0f172a;
    --bg-color: #f8fafc;
    --surface: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --text: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* Glassmorphism */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

.glass-panel-strong {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.5px;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.nav-btn i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

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

.nav-btn.active i {
    color: white;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.doc-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.sidebar-action {
    margin-top: auto;
}

/* Main */
.main-content {
    flex: 1;
    height: 100%;
    padding: 20px;
    overflow: hidden;
}

#calendar-container {
    height: 100%;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

#calendar {
    flex: 1;
    height: 100%;
}

/* FullCalendar Custom Overrides to match aesthetics */
.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-color);
}

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

.fc-button-primary {
    background-color: white !important;
    color: var(--text) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    text-transform: capitalize !important;
}

.fc-button-primary:hover {
    background-color: #f1f5f9 !important;
}

.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.fc-toolbar-title {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: var(--secondary) !important;
}

.fc-event {
    border-radius: 4px;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.85em;
    padding: 2px 4px;
    cursor: pointer;
    transition: transform 0.1s;
}

.fc-event:hover {
    transform: scale(1.02);
}

/* Strike out cancelled apps */
.fc-event.status-cancelled {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: #94a3b8 !important;
}

.fc-event.status-completed {
    border-left: 4px solid var(--success) !important;
}

/* Forms & Buttons */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.req {
    color: var(--danger);
}

.modern-input {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    background: #fdfdfd;
}

.modern-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(2, 132, 199, 0.2);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(2, 132, 199, 0.3);
}

.secondary-btn {
    background: white;
    color: var(--text);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f1f5f9;
}

.danger-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.icon-btn i {
    width: 16px;
    height: 16px;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.2s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

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

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--secondary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.close-modal:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.01);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Toast System */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
}

.toast {
    background: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast i {
    width: 18px;
    height: 18px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

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

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