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

:root {
    --color-bg: #F4F7F6;
    --color-primary: #8CA196;
    --color-primary-hover: #7A8E83;
    --color-secondary: #8D9FAD;
    --color-text-main: #2F3E46;
    --color-text-muted: #5C6B73;
    --color-white: #FFFFFF;
    --color-error: #E07A5F;
    
    --shadow-soft: 0 8px 32px 0 rgba(47, 62, 70, 0.05);
    --shadow-hover: 0 12px 40px 0 rgba(47, 62, 70, 0.1);
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vh;
    background-image: url('../images/logo_ataraxia.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
}

/* Logos */
.logo-brand {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-login {
    height: 90px;
    width: auto;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--color-text-main);
}

/* Glassmorphism utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    flex: 1;
    background: linear-gradient(135deg, var(--color-bg) 0%, #E8F0ED 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    margin: 0 auto;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid rgba(140, 161, 150, 0.3);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-main);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(140, 161, 150, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 161, 150, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: rgba(140, 161, 150, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: rgba(224, 122, 95, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(224, 122, 95, 0.2);
}

/* Navbar Premium */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(140, 161, 150, 0.2);
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(47, 62, 70, 0.03);
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
}

.nav-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* Layout Main Content */
.main-content {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(140, 161, 150, 0.2);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

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

.metric-icon {
    width: 60px;
    height: 60px;
    background: rgba(140, 161, 150, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.metric-info h3 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-info .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    color: var(--color-text-main);
}

/* Tablas */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid rgba(140, 161, 150, 0.2);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(140, 161, 150, 0.1);
}

.table th {
    background: #FAFCFB;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.table tbody tr:hover {
    background-color: rgba(140, 161, 150, 0.03);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-active { background: rgba(140, 161, 150, 0.15); color: var(--color-primary); }
.badge-inactive { background: rgba(224, 122, 95, 0.1); color: var(--color-error); }

/* Search Bar */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    max-width: 400px;
}

/* Grid Layout for Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.form-grid-full {
    grid-column: 1 / -1;
}

.text-decoration-none {
    text-decoration: none;
}

/* Calendar and Timeline */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(140, 161, 150, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.calendar-day-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    border-bottom: 1px solid rgba(140, 161, 150, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.timeline-item {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(140, 161, 150, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    align-items: center;
    transition: var(--transition-fast);
}

.timeline-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.timeline-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    width: 120px;
    border-right: 2px solid rgba(140, 161, 150, 0.2);
    margin-right: 1.5rem;
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    margin-bottom: 0.25rem;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(140, 161, 150, 0.2);
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-primary);
    background: rgba(140, 161, 150, 0.05);
}

.tab-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(140, 161, 150, 0.2);
}

/* Badge variations for Citas */
.badge-prog { background: rgba(141, 159, 173, 0.15); color: var(--color-secondary); }
.badge-comp { background: rgba(140, 161, 150, 0.15); color: var(--color-primary); }
.badge-canc { background: rgba(224, 122, 95, 0.1); color: var(--color-error); }
.badge-no_asis { background: rgba(92, 107, 115, 0.1); color: var(--color-text-muted); }
