/* =============================================
   Clinic Hub - Design System
   ============================================= */

:root {
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.08), 0 2px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 30px -4px rgb(0 0 0 / 0.10), 0 4px 12px -4px rgb(0 0 0 / 0.07);
    --border: 1px solid rgb(226 232 240);
    --brand: #0f766e;
    --brand-light: #ccfbf1;
}

.shad-input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: #fff;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.shad-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.shad-input::placeholder {
    color: #94a3b8;
}

.shad-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: #fff;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    resize: vertical;
}

.shad-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.shad-textarea::placeholder {
    color: #94a3b8;
}

.shad-select {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: #fff;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.shad-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.shad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    cursor: pointer;
    outline: none;
    border: none;
    white-space: nowrap;
}

.shad-btn:active {
    transform: scale(0.98);
}

.shad-btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.shad-btn-primary:hover {
    background: #115e59;
}

.shad-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.shad-btn-outline {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.shad-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.shad-btn-ghost {
    background: transparent;
    color: #64748b;
}

.shad-btn-ghost:hover {
    background: #f1f5f9;
    color: #334155;
}

.shad-btn-sm {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    border-radius: calc(var(--radius) - 2px);
}

.shad-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.shad-badge {
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    padding: 0 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.shad-badge-default {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.shad-badge-brand {
    background: var(--brand-light);
    color: var(--brand);
    border-color: #99f6e4;
}

.shad-badge-success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.shad-badge-warn {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.shad-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

.shad-separator {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 0;
}

.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.glass-dark {
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-input {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(209, 213, 219, 0.5);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

#main-sidebar {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#sidebar-overlay.active {
    display: block;
}

@media (max-width: 1023px) {
    #main-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 20;
        transform: translateX(-100%);
    }

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

#mobile-topbar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 9;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 1023px) {
    #mobile-topbar {
        display: flex;
    }
}

#sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s;
}

#sidebar-toggle:hover {
    background: #f1f5f9;
}

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

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

.animate-fade-in {
    animation: fadeIn 0.35s ease-out forwards;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 45%, #eff6ff 100%);
}

.text-brand {
    color: #115e59;
}

.bg-brand {
    background-color: #0f766e;
}

.patient-item-active {
    background: var(--brand-light) !important;
    border-left: 3px solid var(--brand);
}
