:root {
    /* Specialized Medical Palette */
    --primary: #0d9488;
    /* Teal 600 */
    --primary-dark: #0f766e;
    /* Teal 700 */
    --primary-light: #2dd4bf;
    /* Teal 400 */
    --primary-soft: rgba(13, 148, 136, 0.1);

    --secondary: #64748b;
    /* Slate 500 */
    --accent: #0ea5e9;
    /* Sky 500 */

    /* Appointment Status */
    --status-prog: #0ea5e9;
    --status-att: #10b981;
    --status-nop: #f59e0b;
    --status-can: #ef4444;

    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);

    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Shared Styles */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --glass-blur: blur(12px);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #2dd4bf;
    --primary-dark: #14b8a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
.clinic-name,
.btn,
.stats-value {
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-main);
    background-image: radial-gradient(at 0% 0%, hsla(173, 100%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(199, 100%, 95%, 1) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    transition: var(--transition);
}

[data-theme="dark"] body {
    background-image: radial-gradient(at 0% 0%, hsla(173, 50%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(199, 50%, 15%, 1) 0, transparent 50%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-wrapper {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glassmorphism */
.glass {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 2.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.clinic-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 0.5rem;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
}

.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown-item:last-child {
    border-bottom: none;
    color: #ef4444;
}

.dropdown-item:last-child:hover {
    background: #fee2e2;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 800;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-soft);
}

.btn-danger {
    background: var(--status-can);
    color: white;
}

.btn-warning {
    background: var(--status-nop);
    color: white;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stats-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stats-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.hour-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.hour-label {
    min-width: 60px;
    font-weight: 700;
    font-family: 'Outfit';
    color: var(--primary);
    font-size: 1.1rem;
}

.appointment-info {
    flex-grow: 1;
}

.client-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.status-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.status-programada {
    background: #e0f2fe;
    color: #0369a1;
}

.status-atendida {
    background: #dcfce7;
    color: #15803d;
}

.status-canceló {
    background: #fee2e2;
    color: #b91c1c;
}

/* Form styles */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Notifications (Toasts) */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.info {
    background: #0ea5e9;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 0.75rem;
    }

    header {
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
    }

    .desktop-nav .btn span {
        display: none;
    }
}