/**
 * CSS cho hệ thống quản lý doanh số
 * Mobile-friendly và responsive
 */

/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Màu chính - Xanh lá đậm */
    --primary-color: #006A4A;
    --primary-dark: #004d35;
    --primary-light: #008060;
    --primary-lighter: #00a86b;
    
    /* Màu phụ - Xanh dương nhạt */
    --secondary-color: #4a90a4;
    --secondary-dark: #3a7080;
    --secondary-light: #6ba8c0;
    
    /* Màu accent - Cam để tạo điểm nhấn */
    --accent-color: #ff6b35;
    --accent-dark: #e55a2b;
    --accent-light: #ff8c5a;
    
    /* Màu trạng thái */
    --success-color: #00a86b;
    --success-light: #00c97a;
    --error-color: #e74c3c;
    --error-light: #ff6b5a;
    --warning-color: #f39c12;
    --warning-light: #f5b041;
    --info-color: #3498db;
    --info-light: #5dade2;
    
    /* Màu nền */
    --bg-color: #f5f7fa;
    --bg-light: #ffffff;
    --card-bg: #ffffff;
    --sidebar-bg: #003d2a;
    --sidebar-hover: #005a42;
    
    /* Màu chữ */
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-light: #8a8a8a;
    --text-on-primary: #ffffff;
    
    /* Màu viền */
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --border-dark: #c0c0c0;
    
    /* Shadow */
    --shadow: 0 2px 4px rgba(0, 106, 74, 0.1), 0 1px 2px rgba(0, 106, 74, 0.06);
    --shadow-lg: 0 10px 20px rgba(0, 106, 74, 0.15), 0 4px 8px rgba(0, 106, 74, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 106, 74, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 168, 107, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(74, 144, 164, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background-color: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 106, 74, 0.1);
}

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

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 106, 74, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

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

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

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

.btn-warning:hover {
    background-color: var(--warning-dark, #d68910);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    font-size: 20px;
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert-success {
    background-color: rgba(0, 168, 107, 0.1);
    color: #006A4A;
    border: 1px solid rgba(0, 168, 107, 0.3);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: #d68910;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* Login Footer */
.login-footer {
    margin-top: 30px;
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 70px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar:hover {
    width: 260px;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed:hover {
    width: 260px;
}

.sidebar .sidebar-header h2,
.sidebar .sidebar-nav span:not(.icon),
.sidebar .user-details,
.sidebar .user-name,
.sidebar .user-role,
.sidebar .dropdown-arrow {
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar:hover .sidebar-header h2,
.sidebar:hover .sidebar-nav span:not(.icon),
.sidebar:hover .user-details,
.sidebar:hover .user-name,
.sidebar:hover .user-role,
.sidebar:hover .dropdown-arrow {
    opacity: 1;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-nav span:not(.icon),
.sidebar.collapsed .user-details,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role,
.sidebar.collapsed .dropdown-arrow {
    opacity: 0;
}

.sidebar.collapsed:hover .sidebar-header h2,
.sidebar.collapsed:hover .sidebar-nav span:not(.icon),
.sidebar.collapsed:hover .user-details,
.sidebar.collapsed:hover .user-name,
.sidebar.collapsed:hover .user-role,
.sidebar.collapsed:hover .dropdown-arrow {
    opacity: 1;
}

.sidebar .sidebar-nav a {
    justify-content: flex-start;
    padding: 6px 20px;
}

.sidebar:hover .sidebar-nav a {
    justify-content: flex-start;
    padding: 6px 20px;
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 6px;
}

.sidebar.collapsed:hover .sidebar-nav a {
    justify-content: flex-start;
    padding: 6px 20px;
}

/* Removed duplicate sidebar-footer padding rules - using the ones below */

/* Sidebar footer buttons */
.sidebar-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.sidebar-footer-btn .btn-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer-btn .btn-text {
    transition: opacity 0.2s ease, width 0.2s ease;
}

/* Khi sidebar collapsed, ẩn text và chỉ hiển thị icon */
.sidebar.collapsed .sidebar-footer-btn .btn-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-footer-btn {
    justify-content: center;
    padding: 8px;
    min-width: 44px;
}

.sidebar.collapsed:hover .sidebar-footer-btn .btn-text {
    opacity: 1;
    width: auto;
}

.sidebar.collapsed:hover .sidebar-footer-btn {
    justify-content: flex-start;
    padding: 8px 16px;
    min-width: auto;
}

/* User info styles moved to user-info-dropdown section */

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toggle-icon {
    font-size: 18px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 1px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.sidebar-nav li.active a {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-nav .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Sub-menu styles */
.menu-item-with-submenu {
    position: relative;
}

.menu-toggle {
    position: relative;
}

.submenu-arrow {
    font-size: 10px;
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.7;
}

.menu-item-with-submenu.active .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.menu-item-with-submenu.active .submenu,
.menu-item-with-submenu .submenu.open {
    display: block;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding-left: 50px !important;
    font-size: 14px;
}

.submenu .icon {
    font-size: 16px;
    width: 20px;
}

.sidebar .submenu-arrow,
.sidebar.collapsed .submenu-arrow {
    opacity: 0;
}

.sidebar:hover .submenu-arrow,
.sidebar.collapsed:hover .submenu-arrow {
    opacity: 0.7;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-footer-top {
    margin-top: 0;
    margin-bottom: 0;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar:hover .sidebar-footer,
.sidebar:hover .sidebar-footer-top {
    padding: 15px;
}

.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-footer-top {
    padding: 10px;
}

.sidebar.collapsed:hover .sidebar-footer,
.sidebar.collapsed:hover .sidebar-footer-top {
    padding: 15px;
}

/* User Info Dropdown */
.user-info-dropdown {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s;
    margin-left: auto;
}

.user-info-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    display: none;
    margin-top: 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.user-info-dropdown.active .user-menu-dropdown {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 14px;
}

.user-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-menu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
}

.user-menu-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
    color: white;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 70px;
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar:hover ~ .main-content {
    margin-left: 260px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

.sidebar.collapsed:hover ~ .main-content {
    margin-left: 260px;
}

/* Override sidebar hover effects on mobile */
@media (max-width: 768px) {
    .sidebar:hover ~ .main-content,
    .sidebar.collapsed ~ .main-content,
    .sidebar.collapsed:hover ~ .main-content {
        margin-left: 0 !important;
    }
}

.content-header {
    background-color: var(--card-bg);
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.welcome-text {
    color: var(--text-secondary);
    font-size: 11px;
}

.content-body {
    padding: 32px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-left: 3px solid var(--primary-color);
}

.stat-icon {
    font-size: 40px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 106, 74, 0.2);
}

.stat-content {
    flex: 1;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* Info Box */
.info-box {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.info-box h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.info-box p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-box ul {
    margin-left: 20px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.info-box li {
    margin-bottom: 8px;
}

.warning-text {
    background-color: rgba(243, 156, 18, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
    margin-top: 16px;
    color: var(--text-primary);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Thêm padding từ viền màn hình cho body */
    body {
        padding: 0 12px !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar:hover {
        width: 260px;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 0;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .content-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--card-bg);
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .content-header h1 {
        font-size: 18px;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .content-body {
        padding: 16px 0;
        padding-top: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 32px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .info-box {
        padding: 20px;
    }
    
    .info-box h2 {
        font-size: 18px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    /* Table responsive */
    .table-container {
        padding: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    /* Form responsive */
    .form-container {
        padding: 20px;
    }
    
    .form-section {
        margin-bottom: 24px;
        padding-bottom: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Search box */
    .search-form {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-form .btn {
        width: 100%;
    }
    
    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .page-info {
        font-size: 12px;
    }
    
    /* Detail page */
    .detail-container {
        padding: 20px;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .detail-logo {
        width: 100px;
        height: 100px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Badge legend */
    .badge-legend {
        width: 100%;
    }
    
    /* Calendar notes */
    .calendar-notes ul {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    /* Thêm padding từ viền màn hình cho body */
    body {
        padding: 0 12px !important;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-box {
        padding: 24px 16px;
    }
    
    .content-body {
        padding: 16px 0;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .content-header {
        padding: 10px 12px;
    }
    
    .content-header h1 {
        font-size: 16px;
    }
    
    .form-container {
        padding: 16px;
    }
    
    .detail-container {
        padding: 16px;
    }
    
    .table-container {
        padding: 8px;
    }
    
    .data-table {
        font-size: 11px;
        min-width: 500px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Table Styles */
.table-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background-color: var(--bg-color);
}

.data-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    white-space: nowrap;
}

.data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.data-table tbody tr:hover {
    background-color: var(--bg-color);
}

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

.text-center {
    text-align: center;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: rgba(0, 168, 107, 0.1);
    color: var(--success-color);
}

.badge-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
}

.badge-info {
    background-color: rgba(74, 144, 164, 0.1);
    color: var(--secondary-color);
}

/* Search Box */
.search-box {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 106, 74, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px;
    background-color: var(--card-bg);
    border-radius: 8px;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Logo Thumbnail */
.logo-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.no-logo {
    color: var(--text-light);
    font-size: 12px;
}

/* Form Styles */
.form-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 106, 74, 0.1);
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: all 0.2s;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 106, 74, 0.1);
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.required {
    color: var(--error-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Checkbox đẹp hơn cho toàn bộ màn hình */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #006A4A;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #006A4A;
}

.current-logo {
    margin-bottom: 16px;
}

.current-logo img {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

/* Form Compact */
.form-compact .form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.form-compact .form-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.form-compact .form-group {
    margin-bottom: 16px;
}

.form-compact .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
}

.form-compact .form-group input,
.form-compact .form-group select,
.form-compact .form-group textarea {
    padding: 8px 12px;
    font-size: 14px;
}

.form-compact .form-group small {
    font-size: 11px;
}

/* Form Ultra Compact - Cho donhang-create */
.form-ultra-compact {
    padding: 20px !important;
}

.content-body-compact {
    padding: 16px !important;
}

.form-section-compact {
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
}

.form-section-title-compact {
    font-size: 14px !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
}

.form-row-compact {
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.form-group-compact {
    margin-bottom: 12px !important;
}

.form-group-compact label {
    font-size: 12px !important;
    margin-bottom: 4px !important;
}

.form-group-compact input,
.form-group-compact select,
.form-group-compact textarea {
    padding: 6px 10px !important;
    font-size: 13px !important;
}

.form-group-compact textarea {
    rows: 2;
}

.form-group-compact small {
    font-size: 10px !important;
    margin-top: 2px !important;
}

/* === Đồng bộ ô chọn ngày (calendar) toàn hệ thống - giống Ngày chốt phongkham-create === */
input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary, #1a1a1a);
    min-height: 38px;
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color, #006A4A);
    box-shadow: 0 0 0 2px rgba(0, 106, 74, 0.15);
}
/* Calendar icon clickable toàn ô (Chrome/Safari) */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}
input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.form-actions-compact {
    margin-top: 16px !important;
    padding-top: 16px !important;
}

.form-actions-compact .btn {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

/* Form Ultra Compact cho phongkham-create */
.form-ultra-compact {
    padding: 16px !important;
}

.content-body-compact {
    padding: 16px !important;
}

.form-section-compact {
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
}

.form-section-title-compact {
    font-size: 13px !important;
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
}

.form-row-compact {
    gap: 10px !important;
    margin-bottom: 10px !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

.form-group-compact {
    margin-bottom: 10px !important;
}

.form-group-compact label {
    font-size: 11px !important;
    margin-bottom: 3px !important;
}

.form-group-compact input,
.form-group-compact select,
.form-group-compact textarea {
    padding: 5px 8px !important;
    font-size: 12px !important;
}

/* Input tên phòng khám dài hơn */
.form-group-compact input[name="ten_phongkham"] {
    min-width: 250px !important;
    width: 100% !important;
}

.form-group-compact textarea {
    rows: 2;
}

.form-group-compact small {
    font-size: 9px !important;
    margin-top: 2px !important;
}

.form-actions-compact {
    margin-top: 12px !important;
    padding-top: 12px !important;
}

.form-actions-compact .btn {
    padding: 6px 14px !important;
    font-size: 13px !important;
}

/* Detail Page */
.detail-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.detail-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 8px;
    background-color: var(--bg-color);
}

.detail-header h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.detail-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.detail-value-highlight {
    font-size: 18px !important;
    font-weight: 600;
    color: var(--primary-color) !important;
}

.detail-note {
    background-color: var(--bg-color);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    line-height: 1.8;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Print Styles */
@media print {
    .sidebar,
    .content-header,
    .header-actions {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* PWA Styles */
.pwa-install-btn {
    background: #006A4A;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pwa-install-btn:hover {
    background: #005a3f;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 106, 74, 0.25);
}

.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #006A4A;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 90%;
    animation: slideUp 0.3s ease-out;
    transition: opacity 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.pwa-update-btn {
    background: #006A4A;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-update-btn:hover {
    background: #005a3f;
}

.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: auto;
}

.pwa-dismiss-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* PWA Installed State */
.pwa-installed .pwa-install-btn {
    display: none;
}

/* Mobile PWA Styles */
@media (max-width: 768px) {
    .pwa-install-btn {
        font-size: 11px;
        padding: 6px 12px;
        margin-left: 6px;
    }
    
    .pwa-update-notification {
        bottom: 80px; /* Above bottom nav */
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        padding: 14px 16px;
    }
    
    .pwa-update-content {
        font-size: 13px;
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .pwa-update-content span {
        flex: 1;
        min-width: 0;
    }
    
    .pwa-update-btn {
        font-size: 12px;
        padding: 8px 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .pwa-dismiss-btn {
        flex-shrink: 0;
    }
}

/* Bottom Navigation Bar (Mobile) */
.bottom-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* Support for iPhone notch */
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    text-decoration: none;
    color: #666;
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    min-height: 60px;
    position: relative;
}

/* Border giữa các nút menu */
.bottom-nav-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background-color: #e0e0e0;
}

.bottom-nav-item:active {
    background: #f5f5f5;
}

.bottom-nav-item.active {
    color: #006A4A;
}

.bottom-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
}

.bottom-nav-label {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Ẩn label trên mobile - chỉ hiển thị icon */
@media (max-width: 768px) {
    .bottom-nav-label {
        display: none;
    }
    
    .bottom-nav-item {
        padding: 10px 4px;
        min-height: 50px;
    }
    
    .bottom-nav-icon {
        margin-bottom: 0;
        font-size: 22px;
    }
    
    .bottom-nav {
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
}

/* Bottom Nav Submenu Modal */
.bottom-nav-submenu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.bottom-nav-submenu.show {
    display: block;
    visibility: visible;
    opacity: 1;
}

.bottom-nav-submenu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.bottom-nav-submenu-content {
    position: absolute;
    bottom: 65px; /* Above bottom nav */
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bottom-nav-submenu.show .bottom-nav-submenu-content {
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.bottom-nav-submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.bottom-nav-submenu-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.bottom-nav-submenu-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.bottom-nav-submenu-close:hover {
    background: #f0f0f0;
    color: #333;
}

.bottom-nav-submenu-items {
    padding: 8px 0;
}

.bottom-nav-submenu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.bottom-nav-submenu-item:hover {
    background: #f5f5f5;
}

.bottom-nav-submenu-item.active {
    background: #e8f5f0;
    border-left-color: #006A4A;
    color: #006A4A;
    font-weight: 600;
}

.bottom-nav-submenu-item .submenu-icon {
    font-size: 24px;
    width: 36px;
    text-align: center;
}

.bottom-nav-submenu-item .submenu-label {
    font-size: 16px;
    flex: 1;
}

/* Show bottom nav on mobile only */
@media (max-width: 768px) {
    /* Reset body và html */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    /* Add padding bottom to main content to avoid overlap */
    .main-content {
        padding-bottom: 65px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Hide sidebar completely on mobile - không dùng sidebar trên mobile nữa */
    .sidebar {
        display: none !important;
        width: 0 !important;
        transform: translateX(-100%) !important;
        position: absolute !important;
        left: -9999px !important;
        visibility: hidden !important;
    }
    
    /* Hide mobile menu toggle và overlay */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-overlay {
        display: none !important;
    }
    
    /* Ensure wrapper takes full width */
    .wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        position: relative !important;
    }
    
    /* Override all sidebar hover effects */
    .sidebar:hover ~ .main-content,
    .sidebar.collapsed ~ .main-content,
    .sidebar.collapsed:hover ~ .main-content {
        margin-left: 0 !important;
    }
    
    /* Content body full width */
    .content-body {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        box-sizing: border-box !important;
    }
    
    .content-header {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure no element creates left spacing */
    .main-content > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .mobile-menu-toggle {
        display: none; /* Hide hamburger menu when bottom nav is active */
    }
    
    /* Hide mobile overlay when not active */
    .mobile-overlay:not(.active) {
        display: none !important;
    }
}

/* Mobile menu overlay adjustments */
@media (max-width: 768px) {
    .mobile-overlay.active ~ .sidebar {
        display: flex !important; /* Show sidebar when overlay is active */
        width: 260px !important;
        z-index: 1001;
    }
}
