:root {
    --primary: #00609b; /* Profesional Navy Blue like Dentalink */
    --primary-hover: #004a77;
    --bg-main: #f8fafc; /* Light gray background */
    --bg-card: #ffffff; /* White cards */
    --text-main: #0f172a; /* Dark text for readability */
    --text-muted: #64748b; /* Slate gray for secondary text */
    --border: #e2e8f0; /* Soft borders */
    --success: #22c55e;
    --danger: #ef4444;
    --accent-green: #37b24d; /* For patient sidebar active state */
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Sidebar & Navigation */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    color: var(--text-muted);
}

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

.nav-dropdown {
    cursor: pointer;
}

.submenu {
    list-style: none;
    padding-left: 2rem;
    display: none;
}

.nav-dropdown.active + .submenu {
    display: block;
}

.nav-dropdown .fa-chevron-down {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.nav-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Auth / Login */
.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.4)), url('../img/login_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}

.login-widgets {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-out;
}

.widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 150px;
}

.widget h3 { font-size: 2.5rem; margin: 0; font-weight: 700; }
.widget p { font-size: 0.875rem; margin-top: 0.5rem; opacity: 0.8; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
}

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

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

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

label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: white;
    outline: none;
}

input:focus {
    border-color: var(--primary);
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Tablas */
.table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

/* Patient Specific Toolbar/Sidebar (Dentalink Style) */
.patient-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    background: var(--bg-card);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    overflow: hidden;
    min-height: 80vh;
}

.patient-sidebar {
    background: #00609b;
    color: white;
    display: flex;
    flex-direction: column;
}

.patient-sidebar .patient-info-header {
    background: #0680b5;
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.patient-sidebar .patient-info-header i {
    font-size: 1.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.patient-sidebar .nav-group {
    margin-bottom: 1rem;
}

.patient-sidebar .nav-group-title {
    padding: 1rem 1rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

.patient-sidebar .nav-link-p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.patient-sidebar .nav-link-p:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.patient-sidebar .nav-link-p.active {
    background: #37b24d;
    color: white;
    position: relative;
}

.patient-sidebar .nav-link-p.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--bg-card);
}

/* Patient Photo Section */
.patient-photo-container {
    width: 250px;
    padding: 1rem;
    text-align: center;
}

.patient-avatar {
    width: 200px;
    height: 250px;
    background: #f1f5f9;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.patient-avatar .no-photo {
    font-size: 8rem;
    color: #cbd5e1;
}

.avatar-upload-btn {
    position: absolute;
    bottom: -15px;
    right: -15px;
    background: #f97316;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

/* Form Styles */
.dentalink-form-header {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0;
}

.dentalink-form {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.dentalink-table-form {
    width: 100%;
    border-collapse: collapse;
}

.dentalink-table-form td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f3f5;
}

.dentalink-table-form td:first-child {
    width: 180px;
    text-align: right;
    font-size: 0.95rem;
    color: #212529;
    background: #fff;
    font-weight: 600;
}

.dentalink-input {
    width: 100%;
    max-width: 350px;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #212529;
    font-size: 1rem;
}

