/* ============================================
   HUDT Clinic Management - Main Stylesheet
   ============================================ */

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f4f6f9;
    margin: 0;
    color: #2c3e50;
    font-size: 14px;
}

/* ==== LAYOUT ==== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #3d1e6d 0%, #5a2ea6 100%);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.brand-text strong {
    display: block;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.brand-text small {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    padding: 15px 20px 5px;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: #ffc107;
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #ffc107;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 22px;
}

/* ==== MAIN CONTENT ==== */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.topbar {
    background: #fff;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title {
    color: #3d1e6d;
    font-weight: 600;
}

.sidebar-toggle {
    font-size: 22px;
    color: #3d1e6d;
    padding: 5px 10px;
}

.datetime {
    font-size: 13px;
    color: #6c757d;
}

.user-btn {
    color: #3d1e6d !important;
    text-decoration: none;
    font-weight: 500;
}

.user-btn i {
    font-size: 20px;
    margin-right: 5px;
}

.user-btn small {
    opacity: 0.7;
    margin-left: 4px;
}

/* ==== PAGE CONTENT ==== */
.page-content {
    padding: 25px;
    flex: 1;
}

.app-footer {
    background: #fff;
    padding: 12px 25px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

/* ==== CARDS ==== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    font-weight: 600;
    color: #3d1e6d;
    border-radius: 10px 10px 0 0 !important;
}

/* ==== STAT CARDS ==== */
.stat-card {
    padding: 20px;
    border-radius: 10px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    font-size: 45px;
    opacity: 0.3;
}

.stat-card .stat-info h3 {
    font-size: 28px;
    margin: 0;
    font-weight: 700;
}

.stat-card .stat-info p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.stat-primary { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-success { background: linear-gradient(135deg, #11998e, #38ef7d); }
.stat-warning { background: linear-gradient(135deg, #f7971e, #ffd200); }
.stat-danger { background: linear-gradient(135deg, #eb3349, #f45c43); }
.stat-info { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.stat-dark { background: linear-gradient(135deg, #3d1e6d, #5a2ea6); }

/* ==== BUTTONS ==== */
.btn-primary {
    background: #3d1e6d;
    border-color: #3d1e6d;
}
.btn-primary:hover {
    background: #5a2ea6;
    border-color: #5a2ea6;
}

/* ==== LOGIN PAGE ==== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3d1e6d 0%, #5a2ea6 50%, #7b3fd4 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 25px;
}

.login-logo img {
    width: 90px;
    margin-bottom: 15px;
}

.login-logo h4 {
    color: #3d1e6d;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 18px;
}

.login-logo p {
    color: #6c757d;
    font-size: 12px;
    margin: 0;
}

.login-card .form-control {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: #3d1e6d;
    box-shadow: 0 0 0 0.2rem rgba(61,30,109,0.15);
}

.login-card .btn-primary {
    padding: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    width: 100%;
    margin-top: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 12px;
    color: #6c757d;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* Table */
.table {
    background: #fff;
}
.table thead th {
    background: #f8f9fa;
    color: #3d1e6d;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #dee2e6;
}

/* ===== Patient Type Radio Cards ===== */
.patient-type-radio {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin: 0 !important;
    cursor: pointer;
    transition: all 0.2s;
}
.patient-type-radio:has(input:checked) {
    border-color: #3d1e6d;
    background: #f5f0ff;
    box-shadow: 0 3px 10px rgba(61,30,109,0.15);
}
.patient-type-radio .form-check-input {
    margin-right: 10px;
}
.patient-type-radio .form-check-label {
    cursor: pointer;
    width: 100%;
}

/* Patient avatar */
.patient-avatar { line-height: 1; }