/* ========================================
   PROFESSIONAL ADMIN DASHBOARD THEME
   Bootstrap 5 - Fully Responsive
   ======================================== */

:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --lighter: #f3f4f6;
    --dark: #212529;
    --darker: #1a1d1f;
    --gray: #6b7280;
    --gray-light: #e9ecef;
    --border: #dee2e6;
    --white: #ffffff;
    --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);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--lighter);
    color: var(--dark);
}

#app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* =============== NAVBAR =============== */
.navbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    flex-shrink: 0;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary);
}

.navbar-brand i {
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: var(--dark);
}

.sidebar-toggle:hover {
    background-color: #f3f4f6;
}

/* Search Bar */
#searchInput {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--primary);
    border-color: transparent;
}

/* Navbar Icon Buttons */
.navbar-container button,
.navbar-container a {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: #4b5563;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-container button:hover,
.navbar-container a:hover {
    background-color: #f3f4f6;
}

/* Notification Badge */
.relative .w-2 {
    width: 0.5rem;
}

.relative .h-2 {
    height: 0.5rem;
}

/* User Avatar */
.w-8 {
    width: 2rem;
}

.h-8 {
    height: 2rem;
}

/* Dropdown Menu */
.group {
    position: relative;
}

.group > div {
    position: absolute;
    right: 0;
    margin-top: 0;
}

.group-hover\:opacity-100:hover {
    opacity: 1 !important;
}

.group-hover\:visible:hover {
    visibility: visible !important;
}

/* =============== MAIN WRAPPER =============== */
.main-wrapper {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* =============== SIDEBAR =============== */
.sidebar {
    width: 220px;
    background: var(--dark);
    color: var(--white);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--border);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu-title {
    padding: 0.5rem 1rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}

.sidebar-menu-title:first-child {
    margin-top: 0;
}

.sidebar-menu-title i {
    font-size: 0.75rem;
}

.submenu-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.submenu-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

.submenu-toggle.collapsed i {
    transform: rotate(-90deg);
}

/* Submenu styling */
.sidebar-submenu {
    display: none;
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(13, 110, 253, 0.3);
    padding-left: 1rem;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-submenu.show {
    display: block;
}

.sidebar-submenu .sidebar-menu-item {
    padding-left: 1.25rem;
    font-size: 0.75rem;
    border-left: none;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-menu-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--white);
    border-left-color: var(--primary);
    padding-left: 1.4rem;
}

.sidebar-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.sidebar-menu-item.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* =============== COMPACT SIDEBAR =============== */
.sidebar.compact {
    width: 80px;
}

.sidebar.compact .sidebar-menu-title {
    display: none;
}

.sidebar.compact .sidebar-menu-item {
    padding: 0.875rem 0;
    justify-content: center;
    position: relative;
}

.sidebar.compact .sidebar-menu-item span {
    display: none;
}

.sidebar.compact .sidebar-menu-item:hover {
    padding-left: 0;
}

.sidebar.compact .sidebar-menu-item i {
    font-size: 1.25rem;
}

/* Tooltip for compact sidebar */
.sidebar.compact .sidebar-menu-item::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.sidebar.compact .sidebar-menu-item:hover::after {
    opacity: 1;
}

/* Main wrapper adjustments for compact sidebar */
.main-wrapper.sidebar-compact {
    gap: 0;
}

.main-wrapper.sidebar-compact .sidebar {
    width: 80px;
}

/* =============== MAIN CONTENT =============== */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    height: 100%;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    background: var(--lighter);
    height: 100%;
    min-height: 0;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--primary);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =============== CARDS & STATS =============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.stat-card-info {
    flex: 1;
}

.stat-label {
    font-size: 0.65rem;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-weight: 600;
    margin-bottom: 0.15rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: inherit;
    margin-bottom: 0.15rem;
}

.stat-change {
    font-size: 0.65rem;
    color: inherit;
    opacity: 0.9;
}

.stat-change.negative {
    color: var(--danger);
}

.stat-icon {
    font-size: 1.5rem;
    color: inherit;
    opacity: 0.25;
    margin-left: 0.75rem;
}

.stat-card.success .stat-icon {
    color: var(--success);
}

.stat-card.warning .stat-icon {
    color: var(--warning);
}

.stat-card.danger .stat-icon {
    color: var(--danger);
}

.stat-card.info .stat-icon {
    color: var(--info);
}

/* Keep Bootstrap grid behavior intact globally.
   Use page/module-specific classes for custom card grids. */

/* Card Styling */
.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: #f8f9fa;
}

.card-header h5 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--dark);
}

.card-body {
    padding: 1rem;
}

.mt-4 {
    margin-top: 1.25rem !important;
}

.mb-4 {
    margin-bottom: 1.25rem !important;
}

.mt-3 {
    margin-top: 0.75rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.text-center {
    text-align: center !important;
}

.text-muted {
    color: #6b7280 !important;
}

.table {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.table thead th {
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.75rem;
}

.table td {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
}

.table-sm {
    font-size: 0.75rem;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem 0.5rem;
}

.btn-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.form-control-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.data-table-wrapper {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.data-table-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.data-table-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-table-header i {
    font-size: 1.5rem;
}

.table {
    margin-bottom: 0;
    background: var(--white);
}

.table thead {
    background-color: var(--light);
    border-bottom: 2px solid var(--border);
}

.table thead th {
    padding: 1.25rem;
    color: var(--dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
    vertical-align: middle;
}

.table tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--dark);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--lighter);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Status Badges */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-danger {
    background-color: #f8d7da;
    color: #842029;
}

.badge-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* =============== BUTTONS =============== */
.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #5c636a;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #bb2d3b;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #146c43;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =============== FORMS & MODALS =============== */
.form-section {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-color: var(--white);
}

.form-control::placeholder {
    color: var(--gray-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: var(--white);
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 10px 10px 0 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* =============== FOOTER =============== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer p {
    margin-bottom: 0.25rem;
}

/* =============== USER MENU DROPDOWN =============== */
#userMenuContainer {
    position: relative;
}

#userMenuToggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

#userMenuToggle:hover {
    background-color: #f3f4f6;
}

#userDropdown {
    position: absolute;
    top: calc(100% + 0.3rem);
    right: 0;
    min-width: 180px;
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    display: block !important;
}

#userDropdown.hidden {
    display: none !important;
}

#userMenuContainer {
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

#userDropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

#userDropdown a:hover {
    background-color: var(--lighter);
    color: var(--primary);
}

/* =============== POS PRODUCT SEARCH =============== */
#productSearch {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

#productSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#productList {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

#productList .list-group-item {
    padding: 1rem !important;
    border: none;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

#productList .list-group-item:last-child {
    border-bottom: none;
}

#productList .list-group-item:hover {
    background-color: #f0f7ff;
    box-shadow: inset 3px 0 0 var(--primary);
    padding-left: 1.25rem !important;
}

#productList .alert {
    border: none;
    border-radius: 0;
}

#productList .row {
    align-items: center;
}

#productList strong {
    color: var(--dark);
    font-weight: 600;
}

#productList .text-muted {
    color: #6b7280;
    font-size: 0.85rem;
}

#productList .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

#productList .badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

#productList .badge-warning {
    background-color: #fff3cd;
    color: #664d03;
}

#productList .badge-danger {
    background-color: #f8d7da;
    color: #842029;
}

#productList .badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

#productList .text-primary {
    color: var(--primary) !important;
    font-size: 1.1rem;
    font-weight: 700;
}

/* =============== SIDEBAR MENU TITLE =============== */
.sidebar-menu-title {
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-menu-title:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* =============== RESPONSIVE DESIGN =============== */

/* Mobile Menu Toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Tablet */
@media (max-width: 992px) {
    .navbar-container {
        gap: 0.75rem;
    }

    #searchInput {
        min-width: 0;
        font-size: 0.8rem;
    }

    .sidebar {
        width: 220px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .table thead th,
    .table tbody td {
        padding: 0.9rem 0.75rem;
    }

    .data-table-header {
        padding: 1rem 1.1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar {
        padding: 0.35rem 0.6rem;
        min-height: 46px;
    }

    .navbar-container {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
        min-height: 38px;
    }

    .navbar-container > .flex.items-center.gap-2 {
        flex: 1;
        min-width: 0;
        gap: 0.35rem;
    }

    .navbar-brand {
        font-size: 0.92rem;
        max-width: calc(100vw - 150px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        gap: 0.35rem;
    }

    .navbar-brand img {
        max-width: 72px;
        height: 20px !important;
    }

    .navbar-container > .flex-1 {
        display: none;
    }

    #searchInput {
        width: 100%;
    }

    .navbar-container > .flex.items-center.gap-2:last-child {
        gap: 0.2rem;
        flex-shrink: 0;
    }

    .navbar-container > .flex.items-center.gap-2:last-child button,
    .navbar-container > .flex.items-center.gap-2:last-child a,
    #userMenuToggle {
        padding: 0.25rem;
    }

    .navbar-container > .flex.items-center.gap-2:last-child button:nth-child(2),
    .navbar-container > .flex.items-center.gap-2:last-child a:nth-child(3) {
        display: none;
    }

    #userMenuToggle .fa-chevron-down {
        display: none;
    }
    
    .sidebar-toggle {
        display: block;
        order: 0;
        padding: 0.25rem;
    }
    
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        position: absolute;
        top: 46px;
        left: 0;
        right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 1020;
    }
    
    .sidebar.show {
        max-height: 500px;
    }
    
    .content-area {
        padding: 0.85rem;
    }
    
    .page-title {
        font-size: 1.2rem;
        gap: 0.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
    
    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
        min-height: 72px;
    }
    
    .stat-icon {
        margin-left: 0.5rem;
        margin-top: 0;
        font-size: 1.4rem;
    }

    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 0.9rem 1rem;
    }

    .data-table-title {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .table {
        min-width: 640px;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.6rem;
        font-size: 0.8rem;
    }

    .table-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .table-actions .btn {
        width: auto;
        justify-content: center;
    }

    .card-header,
    .card-body,
    .form-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-modal {
        padding: 0.65rem;
    }

    .page-modal-card,
    .modal-dialog,
    .modal-content {
        width: 100%;
        max-width: 100%;
    }

    .page-modal-header,
    .page-modal-footer,
    .page-modal-body {
        padding: 0.85rem 0.9rem;
    }

    .page-modal-footer {
        flex-wrap: wrap;
    }

    .page-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .row.g-3 > [class*="col-"] {
        width: 100%;
    }

    .alert {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
}

/* =============== PROFILE PAGE =============== */
.profile-avatar {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.avatar-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item small {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.info-item strong {
    display: block;
    font-size: 0.95rem;
    color: var(--dark);
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background-color: var(--lighter) !important;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.card-header i {
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    font-size: 0.9rem;
}

.form-control {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.form-control:disabled {
    background-color: var(--lighter);
    color: var(--gray);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.btn {
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c82333;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-close {
    padding: 0;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close:hover {
    opacity: 0.7;
}

.alert {
    border-radius: 6px;
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #b6d4fe;
}

.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
    color: var(--white);
}

.badge.bg-success {
    background-color: var(--success) !important;
    color: var(--white);
}

.badge.bg-danger {
    background-color: var(--danger) !important;
    color: var(--white);
}
    
    .data-table-header {
        flex-direction: column;
        text-align: center;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-dialog {
        width: 95%;
        max-width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .navbar {
        min-height: 48px;
    }
    
    .navbar-brand {
        font-size: 0.92rem;
    }

    .navbar-brand i {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.05rem;
    }
    
    .form-control {
        padding: 0.55rem 0.7rem;
        font-size: 0.88rem;
    }
    
    .btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.82rem;
    }
    
    .table {
        min-width: 560px;
        font-size: 0.78rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.65rem 0.45rem;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .stat-label,
    .stat-change {
        font-size: 0.62rem;
    }

    .content-area {
        padding: 0.7rem;
    }

    .badge {
        font-size: 0.68rem;
        padding: 0.3rem 0.5rem;
    }
}

/* =============== UTILITY CLASSES =============== */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }

.text-muted { color: var(--gray); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

/* Alert Styling */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1e7dd;
    border-left-color: var(--success);
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: var(--danger);
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: var(--warning);
    color: #664d03;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: var(--info);
    color: #0c5460;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
