/* ═══════════════════════════════════════════════════════════════
   CLINICA SAAS - Design System
   Sistema de Gestão para Clínicas Multidisciplinares
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ══════════════════════════════════════════════════════════════
   ROOT / DESIGN TOKENS
   ══════════════════════════════════════════════════════════════ */
:root {
    /* Colors - Light Theme */
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #38BDF8;
    --primary-50: #F0F9FF;
    --primary-100: #E0F2FE;
    --primary-200: #BAE6FD;

    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #6366F1;
    --info-light: #E0E7FF;

    /* Background */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-sidebar-active: #F0F9FF;
    --bg-input: #FFFFFF;
    --bg-hover: #F1F5F9;
    --bg-modal: #FFFFFF;

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border: #E2E8F0;
    --border-focus: #0EA5E9;
    --border-input: #CBD5E1;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --sidebar-text: #475569;
    --sidebar-icon: #94A3B8;
    --sidebar-active-text: #0EA5E9;
    --sidebar-active-bg: #F0F9FF;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Navbar */
    --navbar-height: 64px;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --primary: #38BDF8;
    --primary-dark: #0EA5E9;
    --primary-light: #7DD3FC;
    --primary-50: rgba(14, 165, 233, 0.1);
    --primary-100: rgba(14, 165, 233, 0.15);
    --primary-200: rgba(14, 165, 233, 0.2);

    --bg-body: #0F172A;
    --bg-card: #1E293B;
    --bg-sidebar: #1E293B;
    --bg-sidebar-active: rgba(14, 165, 233, 0.1);
    --bg-input: #1E293B;
    --bg-hover: #334155;
    --bg-modal: #1E293B;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0F172A;

    --border: #334155;
    --border-focus: #38BDF8;
    --border-input: #475569;

    --sidebar-text: #94A3B8;
    --sidebar-icon: #64748B;
    --sidebar-active-text: #38BDF8;
    --sidebar-active-bg: rgba(14, 165, 233, 0.1);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    --success-light: rgba(16, 185, 129, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
    --info-light: rgba(99, 102, 241, 0.15);
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition-slow);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* ── Navbar ── */
.navbar {
    height: var(--navbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.navbar-breadcrumb span {
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-logo-text {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-section-title {
    text-align: center;
    font-size: 0;
    padding: 8px 0;
}

.sidebar.collapsed .sidebar-section-title::after {
    content: '•••';
    font-size: 0.6rem;
    display: block;
    text-align: center;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 450;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.sidebar-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 500;
}

.sidebar-link.active .sidebar-link-icon {
    color: var(--sidebar-active-text);
}

.sidebar-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--sidebar-icon);
    transition: var(--transition);
}

.sidebar-link:hover .sidebar-link-icon {
    color: var(--text-primary);
}

.sidebar-link-text {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Content Area ── */
.content-container {
    padding: 24px;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.page-header-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* ── Cards ── */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header h2,
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Stat Cards (Dashboard) ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon.blue {
    background: var(--primary-100);
    color: var(--primary);
}

.stat-card-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-card-icon.orange {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card-icon.purple {
    background: var(--info-light);
    color: var(--info);
}

.stat-card-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

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

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

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

.btn-success:hover {
    background: #059669;
    color: white;
}

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

.btn-danger:hover {
    background: #DC2626;
    color: white;
}

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

.btn-warning:hover {
    background: #D97706;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 10px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

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

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394A3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

/* ── Tables ── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-hover);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

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

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

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

.badge-primary {
    background: var(--primary-100);
    color: var(--primary);
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

/* ── Search / Toolbar ── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.search-box-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination .active span {
    background: var(--primary);
    color: white;
}

.pagination .disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Theme Toggle ── */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── User Menu ── */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    line-height: 1.3;
}

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

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

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    z-index: 100;
    display: none;
    animation: dropdownIn 0.15s ease;
}

.user-dropdown.show {
    display: block;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-decoration: none;
}

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

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: var(--danger-light);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-modal);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Color Dot ── */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 50%, #8B5CF6 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: moveGrid 20s linear infinite;
}

@keyframes moveGrid {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(30px, 30px);
    }
}

.login-left h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.login-left p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--bg-body);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.login-form-container p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-form-container .form-group {
    margin-bottom: 20px;
}

.login-form-container .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.remember-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--primary);
}

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

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

    .main-content {
        margin-left: 0 !important;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .navbar {
        padding: 0 16px;
    }

    .content-container {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-info {
        display: none;
    }
}

/* ── Utility Classes ── */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.hidden {
    display: none;
}

/* ══════════════════════════════════════════════════════════════
   CALENDAR / AGENDA
   ══════════════════════════════════════════════════════════════ */

/* ── Day View ── */
.calendar-day {
    padding: 0;
}

.calendar-hour-row {
    display: flex;
    min-height: 72px;
    border-bottom: 1px solid var(--border);
}

.calendar-hour-row:last-child {
    border-bottom: none;
}

.calendar-hour-label {
    width: 72px;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
    border-right: 1px solid var(--border);
}

.calendar-hour-content {
    flex: 1;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-event {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: default;
    transition: var(--transition);
}

.calendar-event:hover {
    box-shadow: var(--shadow-md);
}

.calendar-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.calendar-event-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-event-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.calendar-event-details {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.calendar-event-actions {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}

.calendar-empty-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 48px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
}

.calendar-hour-content:hover .calendar-empty-slot {
    opacity: 1;
}

.calendar-empty-slot:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary);
}

/* ── Week View ── */
.calendar-week {
    overflow-x: auto;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 2;
}

.calendar-week-hour-label {
    width: 60px;
    flex-shrink: 0;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
    border-right: 1px solid var(--border);
}

.calendar-week-day-header {
    padding: 10px 4px;
    text-align: center;
    font-size: 0.8rem;
    border-right: 1px solid var(--border);
}

.calendar-week-day-header:last-child {
    border-right: none;
}

.calendar-week-day-header.today {
    background: var(--primary-50);
}

.calendar-week-day-name {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.calendar-week-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 2px;
}

.today-number {
    background: var(--primary);
    color: white !important;
}

.calendar-week-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-height: 52px;
    border-bottom: 1px solid var(--border);
}

.calendar-week-row:last-child {
    border-bottom: none;
}

.calendar-week-cell {
    border-right: 1px solid var(--border);
    padding: 2px;
    position: relative;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-week-cell:last-child {
    border-right: none;
}

.calendar-week-cell.today-col {
    background: var(--primary-50);
}

.calendar-week-event {
    display: block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.calendar-week-event:hover {
    opacity: 0.85;
    transform: scale(1.02);
    color: white;
}

.calendar-empty-slot-mini {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
}

.calendar-week-cell:hover .calendar-empty-slot-mini {
    display: flex;
}

.calendar-empty-slot-mini:hover {
    color: var(--primary);
}

/* ── Additional Badge Variants ── */
.badge-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
}

/* ── Color Dot ── */
.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Remember Row (Login) ── */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.remember-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ── Tabs (Premium UI) ── */
.tabs-container {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-button {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.tab-button.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}