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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
}

html, body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: visible;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    top: 52px; /* Height of user bar */
    height: calc(100vh - 52px);
    overflow-y: auto;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo i {
    font-size: 28px;
    color: #60a5fa;
}

.logo span {
    font-size: 18px;
    font-weight: 600;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #60a5fa;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    height: calc(100vh - 52px); /* Subtract user bar height */
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 24px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary-color);
}

/* Search and Filter */
.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1;
    max-width: 400px;
}

.search-box i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.filter-box select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Form Styles */
.subject-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.form-section {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2 i {
    color: var(--primary-color);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* QR Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-section .scan-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
}

.qr-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#qr-reader {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

#qr-reader video {
    border-radius: 8px;
}

.qr-result {
    padding: 15px;
    background: var(--background-color);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    word-break: break-all;
    font-size: 14px;
}

.qr-result .qr-success {
    color: var(--success-color);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-result .qr-scanning {
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-result .qr-error {
    color: var(--danger-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-result .qr-data {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.qr-image-preview {
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
}

.qr-image-preview img {
    width: 100%;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

/* Photo Section */
.photo-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.photo-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.photo-input-wrapper {
    position: relative;
}

.photo-input-wrapper input[type="file"] {
    display: none;
}

.photo-btn {
    width: 100%;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.btn-secondary {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 25px 30px;
    background: var(--background-color);
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.subject-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.subject-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
}

.subject-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.subject-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.subject-card-header-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.subject-card-header-info p {
    font-size: 13px;
    opacity: 0.8;
}

.subject-card-body {
    padding: 20px;
}

.subject-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.subject-info-row i {
    width: 16px;
    color: var(--secondary-color);
}

.subject-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.type-matuy {
    background: #fef2f2;
    color: #dc2626;
}

.type-hinhsu {
    background: #fef3c7;
    color: #d97706;
}

.type-kinhte {
    background: #dbeafe;
    color: #2563eb;
}

.type-anninh {
    background: #f3e8ff;
    color: #9333ea;
}

.type-khac {
    background: #f1f5f9;
    color: #64748b;
}

/* Profile Page */
.profile-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.profile-header-info h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

/* Encounter Stars (số lần gặp) */
.encounter-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.encounter-stars .stars-label {
    font-size: 12px;
    opacity: 0.8;
    margin-right: 5px;
}

.encounter-stars .star-icon {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.encounter-stars .star-icon:hover {
    color: #fbbf24;
    transform: scale(1.2);
}

.encounter-stars .star-icon.active {
    color: #fbbf24;
}

.encounter-stars .stars-count {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 8px;
}

.profile-header-info p {
    font-size: 16px;
    opacity: 0.9;
}

.profile-body {
    padding: 30px 40px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-section h3 i {
    color: var(--primary-color);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-item.full-width {
    grid-column: 1 / -1;
}

.profile-item label {
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-item span {
    font-size: 15px;
    color: var(--text-color);
}

.profile-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

.profile-notes {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
}

.profile-qr-data {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    word-break: break-all;
}

/* Edit History Styles */
.edit-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.edit-history-item {
    background: var(--background-color);
    border-radius: 10px;
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
}

.edit-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.edit-number {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 14px;
}

.edit-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.edit-history-body {
    padding: 12px 15px;
}

.edit-by {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.edit-by i {
    color: var(--primary-color);
}

.edit-changes {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* CCCD Scanner Section */
.cccd-scan-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scan-description {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.cccd-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.cccd-upload-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cccd-upload-item label {
    font-weight: 600;
    color: var(--text-color);
}

.cccd-upload-wrapper input[type="file"] {
    display: none;
}

.cccd-btn {
    width: 100%;
    padding: 15px;
    font-size: 14px;
}

.cccd-preview {
    position: relative;
    width: 100%;
    min-height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--background-color);
}

.cccd-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.cccd-preview .remove-cccd {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
}

.cccd-preview-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.cccd-preview-placeholder i {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* OCR Progress */
.ocr-progress {
    padding: 20px;
    background: var(--background-color);
    border-radius: 8px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#ocrStatus {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.ocr-success {
    color: var(--success-color) !important;
    font-weight: 500;
}

.ocr-error {
    color: var(--danger-color) !important;
}

@media (max-width: 768px) {
    .cccd-upload-grid {
        grid-template-columns: 1fr;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Back Button */
.back-btn {
    margin-right: auto;
}

.profile-actions {
    margin-left: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Responsive */

/* Desktop lớn */
@media (min-width: 1200px) {
    .subjects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet ngang */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 15px 0;
    }
    
    .logo span,
    .nav-item span {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 0 10px 20px;
    }
    
    .nav-item {
        justify-content: center;
        padding: 15px 10px;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
    
    .form-grid,
    .photo-section,
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet dọc */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        display: flex;
        flex-direction: row;
        padding: 0;
        z-index: 1000;
        background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    }
    
    .logo {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }
    
    .nav-item {
        flex: 1;
        justify-content: center;
        padding: 10px 5px;
        border-left: none;
        border-top: 3px solid transparent;
        flex-direction: column;
        gap: 4px;
    }
    
    .nav-item.active {
        border-left: none;
        border-top-color: #60a5fa;
    }
    
    .nav-item span {
        display: block;
        font-size: 10px;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: 60px;
        padding: 15px;
        height: auto;
        min-height: calc(100vh - 52px - 60px);
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .search-box {
        max-width: 100%;
        width: 100%;
    }
    
    .filter-box {
        width: 100%;
    }
    
    .filter-box select {
        width: 100%;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .subject-card-header {
        padding: 15px;
    }
    
    .subject-avatar,
    .subject-avatar-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .subject-card-body {
        padding: 15px;
    }
    
    /* Profile responsive */
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 25px 15px;
        gap: 15px;
    }
    
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    
    .profile-header-info h2 {
        font-size: 22px;
    }
    
    .profile-body {
        padding: 15px;
    }
    
    .profile-section h3 {
        font-size: 16px;
    }
    
    .profile-photos {
        justify-content: center;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    /* Form responsive */
    .form-section {
        padding: 15px;
    }
    
    .form-section h2 {
        font-size: 16px;
    }
    
    .form-grid {
        gap: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Tránh zoom trên iOS */
    }
    
    .form-actions {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Buttons touch-friendly */
    .btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    /* QR Scanner */
    .qr-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .qr-buttons .btn {
        width: 100%;
    }
    
    #qr-reader {
        max-width: 100%;
    }
    
    /* Photo section */
    .photo-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .photo-preview-item {
        width: 80px;
        height: 80px;
    }
    
    /* CCCD section */
    .cccd-upload-grid {
        grid-template-columns: 1fr;
    }
    
    /* Toast */
    .toast {
        left: 15px;
        right: 15px;
        bottom: 80px;
        text-align: center;
    }
    
    /* Modal */
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    /* Back button and actions */
    .back-btn {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .profile-actions {
        margin-left: 0;
    }
}

/* Mobile nhỏ */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .subject-card-header-info h3 {
        font-size: 14px;
    }
    
    .subject-card-header-info p {
        font-size: 12px;
    }
    
    .subject-info-row {
        font-size: 13px;
    }
    
    .profile-header-info h2 {
        font-size: 18px;
    }
    
    .profile-item label {
        font-size: 12px;
    }
    
    .profile-item span {
        font-size: 14px;
    }
    
    .profile-photo {
        width: 80px;
        height: 80px;
    }
    
    .form-section h2 {
        font-size: 15px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state i {
        font-size: 40px;
    }
    
    .empty-state h3 {
        font-size: 16px;
    }
    
    /* User bar responsive */
    .user-bar {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    .user-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .user-role {
        font-size: 10px;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Nav items smaller */
    .nav-item span {
        font-size: 9px;
    }
    
    .nav-item i {
        font-size: 16px;
    }
}

/* Landscape mode on phone */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        height: 50px;
    }
    
    .nav-item {
        padding: 8px 5px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .main-content {
        margin-bottom: 50px;
    }
    
    .profile-header {
        flex-direction: row;
        text-align: left;
    }
    
    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
    }
}

/* Fix cho iOS Safari */
@supports (-webkit-touch-callout: none) {
    .main-content {
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    @media (max-width: 768px) {
        .sidebar {
            height: calc(60px + env(safe-area-inset-bottom));
            padding-bottom: env(safe-area-inset-bottom);
        }
        
        .main-content {
            margin-bottom: calc(60px + env(safe-area-inset-bottom));
        }
    }
}

/* Print styles */
@media print {
    .sidebar,
    .user-bar,
    .nav-menu,
    .form-actions,
    .btn,
    .toast {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 20px;
        height: auto;
    }
    
    .profile-content {
        box-shadow: none;
    }
}

