/* ===================================
   ATU Clinic Expert System - Main Styles
   =================================== */

/* CSS Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: all 0.3s ease;
    
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #0b5ed7;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-light {
    border-color: white;
    color: white;
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control.invalid {
    border-color: var(--danger-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-success {
    background-color: #d1e7dd;
    border-left: 4px solid var(--success-color);
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-left: 4px solid var(--danger-color);
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    border-left: 4px solid var(--warning-color);
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    border-left: 4px solid var(--info-color);
    color: #055160;
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert ul li {
    margin-bottom: 0.25rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.badge-pending {
    background-color: #ffc107;
    color: #000;
}

.badge-approved,
.badge-completed {
    background-color: var(--success-color);
    color: white;
}

.badge-rejected {
    background-color: var(--danger-color);
    color: white;
}

.badge-suspended {
    background-color: var(--secondary-color);
    color: white;
}

.badge-high {
    background-color: var(--danger-color);
    color: white;
}

.badge-moderate {
    background-color: var(--warning-color);
    color: #000;
}

.badge-low {
    background-color: var(--info-color);
    color: white;
}

.badge-mild {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-severe {
    background-color: #f8d7da;
    color: #842029;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Dashboard Header */
.dashboard-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
    display: none;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo img {
    height: 40px;
}

.header-logo span {
    font-weight: 600;
    font-size: 1.125rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-search {
    position: relative;
}

.header-search input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 2rem;
    width: 300px;
}

.header-search i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.header-notifications {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    color: var(--dark-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 1rem;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    width: 350px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
}

.mark-all-read {
    font-size: 0.875rem;
    color: var(--primary-color);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    gap: 1rem;
    transition: var(--transition);
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.info {
    background-color: #cfe2ff;
    color: var(--primary-color);
}

.notification-icon.success {
    background-color: #d1e7dd;
    color: var(--success-color);
}

.notification-icon.warning {
    background-color: #fff3cd;
    color: var(--warning-color);
}

.notification-content {
    flex: 1;
}

.notification-content h5 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notification-content p {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin: 0;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.notification-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.notification-footer a {
    font-size: 0.875rem;
    font-weight: 500;
}

.header-profile {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.profile-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    width: 250px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.profile-dropdown-header h4 {
    margin: 0;
    font-size: 1rem;
}

.profile-dropdown-header p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.profile-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--dark-color);
    transition: var(--transition);
}

.profile-dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.logout-link {
    color: var(--danger-color) !important;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 0.5rem 0;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 101;
}

.sidebar-nav {
    padding: var(--header-height) 0 2rem;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    transition: var(--transition);
}

.nav-item a:hover,
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item a i {
    font-size: 1.25rem;
    width: 24px;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.5rem;
}

.sidebar-footer {
    padding: 2rem 1rem;
    margin-top: auto;
}

.help-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.help-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.help-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.help-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    transition: var(--transition);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--secondary-color);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background-color: #cfe2ff;
    color: var(--primary-color);
}

.stat-icon.green {
    background-color: #d1e7dd;
    color: var(--success-color);
}

.stat-icon.orange {
    background-color: #fff3cd;
    color: var(--warning-color);
}

.stat-icon.purple {
    background-color: #e2d9f3;
    color: #6f42c1;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0;
}

.stat-info p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state-large {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-large i {
    font-size: 5rem;
    color: var(--secondary-color);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.show {
        transform: translateX(0);
    }
    
    .dashboard-header {
        left: 0;
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 1rem;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .header-search input {
        width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }