/* EPI Stock Management System - Professional Styles */
/* General Stock - Estilos */

:root {
    /* Cores do sistema */
    --primary-color: #FF6600;
    --primary-dark: #E55A00;
    --primary-light: #FF8533;
    
    /* Cores do Sistema */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Cores Neutras */
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    
    /* Layout */
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#low-stock {
    scroll-margin-top: 90px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    background: #101b2d;
    padding: 16px 20px;
}

.login-page::before,
.login-page::after {
    position: absolute;
    content: '';
    pointer-events: none;
    border-radius: 50%;
}

.login-page::before {
    width: 620px;
    height: 620px;
    top: -290px;
    right: -160px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.025), 0 0 0 120px rgba(255, 255, 255, 0.02);
}

.login-page::after {
    width: 340px;
    height: 340px;
    bottom: -190px;
    left: -110px;
    border: 1px solid rgba(255, 102, 0, 0.35);
}

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

.login-box {
    background: var(--white);
    border-radius: 18px;
    padding: 28px 44px 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.75);
}

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

.login-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 14px;
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 10px 22px rgba(255, 102, 0, 0.28);
    font-size: 20px;
}

.login-logo {
    max-width: 220px;
    max-height: 52px;
    object-fit: contain;
    margin-bottom: 10px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.login-header-line {
    display: block;
    width: 38px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 4px;
    background: var(--primary-color);
}

.login-form .form-group {
    margin-bottom: 14px;
}

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

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: all 0.3s;
    background: var(--white);
    min-height: 44px;
}

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

.login-field label {
    margin-bottom: 8px;
    font-size: 13px;
}

.login-options {
    margin: 2px 0 16px !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
}

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

.btn-block {
    width: 100%;
}

.login-back-form {
    margin-top: 10px;
    text-align: center;
}

.login-back-button {
    padding: 6px 10px;
    border: 0;
    color: var(--text-muted);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

.login-back-button:hover {
    color: var(--primary-color);
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--primary-color);
    background: var(--gray-50);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    color: var(--white);
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.footer_login {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.footer_login p {
    margin: 0;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark-color) 0%, #0f172a 100%);
    color: var(--white);
    position: sticky;
    top: 0;
    left: 0;
    bottom: auto;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.app-container.sidebar-collapsed .sidebar {
    width: 0;
    transform: translateX(-100%);
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h2 {
    font-size: 20px;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-logo {
    max-width: 200px;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 0 0 auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 500;
    margin: 2px 12px;
    border-radius: var(--border-radius-sm);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.nav-item i {
    margin-right: 14px;
    width: 22px;
    font-size: 18px;
    text-align: center;
}

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

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.sidebar-logout i {
    width: 22px;
    text-align: center;
}

.sidebar-logout:hover,
.sidebar-logout:focus-visible {
    color: var(--white);
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-color);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gray-50);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

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

.lang-btn i {
    font-size: 16px;
}

/* Notifications */
.notifications-menu {
    position: relative;
}

.notification-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--gray-50);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1100;
    width: min(380px, calc(100vw - 32px));
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.notification-panel[hidden] {
    display: none;
}

.notification-panel-header,
.notification-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.notification-panel-header {
    border-bottom: 1px solid var(--border-color);
    color: var(--dark-color);
}

.notification-panel-header span {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    color: var(--danger-color);
    background: #fee2e2;
    font-size: 12px;
    text-align: center;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #b45309;
    background: #fef3c7;
}

.notification-item-content {
    min-width: 0;
}

.notification-item-content strong,
.notification-item-content small {
    display: block;
}

.notification-item-content strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item-content small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.notification-panel-footer {
    justify-content: center;
    gap: 8px;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.notification-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.notification-empty i {
    color: var(--success-color);
}

.notification-icon:hover {
    background: var(--warning-color);
    color: var(--white);
    border-color: var(--warning-color);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-name {
    font-weight: 600;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s;
    font-size: 14px;
    color: var(--text-color);
}

.user-role {
    display: block;
    margin: -7px 16px 0;
    color: var(--text-muted);
    font-size: 10px;
    text-align: right;
}

.user-name:hover {
    background: var(--gray-100);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    overflow: hidden;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown a:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

.user-dropdown a i {
    margin-right: 12px;
    width: 18px;
    text-align: center;
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
    flex: 1;
    padding: 32px;
    max-width: 1600px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    min-width: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.report-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.report-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    color: var(--text-color);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
}

.report-tab:hover,
.report-tab.active {
    color: var(--white);
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.report-filters {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 1fr auto;
    align-items: end;
    gap: 16px;
}

.report-filters .form-group {
    margin-bottom: 0;
}

.report-filter-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 24px;
}

.report-summary {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.report-summary > div:not(.report-actions) {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-summary span {
    color: var(--text-muted);
    font-size: 12px;
}

.report-summary strong {
    color: var(--dark-color);
    font-size: 18px;
}

.report-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.text-danger { color: var(--danger-color) !important; }
.text-success { color: var(--success-color) !important; }

.product-summary {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: 24px;
    padding: 18px 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.product-summary div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-summary span {
    color: var(--text-muted);
    font-size: 13px;
}

.product-summary strong {
    color: var(--dark-color);
    font-size: 22px;
}

.stock-column {
    min-width: 190px;
}

.product-stock strong,
.product-stock span,
.product-stock small {
    display: block;
}

.product-stock strong {
    color: var(--dark-color);
    font-size: 18px;
    line-height: 1.1;
}

.product-stock span,
.product-stock small {
    color: var(--text-muted);
    font-size: 11px;
}

.stock-progress {
    height: 6px;
    margin: 8px 0 5px;
    overflow: hidden;
    background: var(--gray-200);
    border-radius: 4px;
}

.stock-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.stock-ok .stock-progress i { background: var(--success-color); }
.stock-warning .stock-progress i { background: var(--warning-color); }

.history-page {
    max-width: 1380px;
    margin: 0 auto;
}

.history-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.history-toolbar {
    padding: 20px 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.history-toolbar .history-filters {
    grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
}

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

.btn-light:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
}

.history-summary {
    display: flex;
    align-items: center;
    gap: 36px;
    min-height: 72px;
    padding: 14px 4px 22px;
}

.history-summary > div:not(.summary-actions) {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.history-summary strong {
    color: var(--dark-color);
    font-size: 22px;
}

.history-summary span {
    color: var(--text-muted);
    font-size: 13px;
}

.summary-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.history-table-wrap {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.history-table-wrap .data-table {
    min-width: 900px;
}

.history-table-wrap > .table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

.history-table-wrap .table-actions {
    width: 116px;
    min-width: 116px;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
}

.history-table-wrap .data-table th:last-child,
.history-table-wrap .data-table td:last-child {
    position: static;
    box-shadow: none;
}

.history-table-wrap .data-table .btn-sm {
    margin: 0 2px;
}

@media (max-width: 1400px) {
    .history-table-wrap .data-table {
        min-width: 0;
        table-layout: fixed;
    }

    .history-table-wrap .data-table th,
    .history-table-wrap .data-table td {
        overflow-wrap: anywhere;
    }

    .history-table-wrap .data-table th:last-child,
    .history-table-wrap .data-table td:last-child {
        width: 116px;
    }
}

.date-cell {
    white-space: nowrap;
    color: var(--text-muted) !important;
    font-size: 13px !important;
}

.empty-history {
    height: 180px;
    text-align: center;
    vertical-align: middle;
}

.empty-history i,
.empty-history strong,
.empty-history span {
    display: block;
}

.empty-history i {
    margin-bottom: 12px;
    color: var(--border-color);
    font-size: 30px;
}

.empty-history strong {
    color: var(--dark-color);
    margin-bottom: 4px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--dark-color);
    letter-spacing: -0.5px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s;
    min-width: 0;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    letter-spacing: -0.3px;
    position: relative;
    padding-left: 16px;
    margin: 0;
    flex: 1;
}

.card-header h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 2px;
}

.card-body {
    padding: 24px;
}

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

.history-stats {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.history-filters {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr) auto;
    align-items: end;
    gap: 16px;
}

.history-filters .form-group {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 24px;
}

.history-count,
.quantity-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.quantity-out {
    color: #b91c1c;
    background: #fee2e2;
}

.stock-help {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.quantity-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    color: #166534;
    background: #dcfce7;
}

.table-responsive {
    overflow-x: auto;
}

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.users-table-wrap .data-table {
    min-width: 760px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   CHARTS
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.chart-card h3 {
    margin-bottom: 24px;
    color: var(--dark-color);
    font-size: 18px;
    font-weight: 700;
}

.chart-card canvas {
    max-height: 320px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: all 0.3s;
    background: var(--white);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon > i {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-with-icon .form-control {
    padding-left: 44px;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    appearance: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

/* Search Bar */
.search-bar {
    margin-bottom: 24px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.search-form .form-control {
    flex: 1;
}

/* ============================================
   TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--dark-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

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

.data-table tbody tr.danger {
    background: #fef2f2;
}

.data-table tbody tr.danger:hover {
    background: #fee2e2;
}

.data-table tbody tr.warning {
    background: #fffbeb;
}

.data-table tbody tr.warning:hover {
    background: #fef3c7;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-secondary {
    background: var(--gray-100);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: var(--white);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: var(--white);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: var(--white);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: var(--white);
}

.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--border-radius-sm);
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.data-table .btn-sm {
    margin: 0 4px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: var(--danger-color);
}

.alert-success {
    background: #f0fdf4;
    color: #065f46;
    border-left-color: var(--success-color);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: var(--warning-color);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-left-color: var(--info-color);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: var(--white);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: var(--white);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: var(--white);
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: var(--white);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: var(--white);
    margin: 3% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s;
}

    max-width: 100%;
    -webkit-overflow-scrolling: touch;
.modal-content.wide {
    width: calc(100% - var(--sidebar-width) - 64px);
    max-width: none;
    margin: 3% 32px 3% calc(var(--sidebar-width) + 32px);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.modal-header h2 {
    margin: 0;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-color);
}

.close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
}

.close:hover {
    color: var(--danger-color);
    transform: scale(1.1);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
}

.modal-content > div:last-child .form-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.user-form-body {
    padding: 32px 40px;
}

.user-form-body form {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.product-form-body {
    padding: 32px 40px;
}

.product-form-body form {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.product-form-body .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.product-form-body .form-group {
    min-width: 0;
}

.product-form-layout {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.table-subtext {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.table-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.inventory-start-card,
.inventory-check-card {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.inventory-selector {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    align-items: end;
    justify-content: center;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
}

.inventory-selector .form-group {
    margin-bottom: 0;
}

.inventory-check-card .data-table {
    margin-bottom: 24px;
}

.inventory-details {
    max-width: 760px;
    margin: 0 auto;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
    width: 100%;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding: 26px 28px;
    color: var(--dark-color);
    background: linear-gradient(135deg, #eef3f7 0%, #ffffff 100%);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
}

.dashboard-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin: 0 0 6px;
    color: var(--dark-color);
    font-size: 30px;
}

.dashboard-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.dashboard-actions .btn-light {
    color: var(--dark-color);
    background: var(--white);
    border-color: var(--white);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.simple-user-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px 28px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.simple-user-panel .dashboard-kicker {
    margin-bottom: 4px;
    color: var(--primary-color);
}

.simple-user-panel h2 {
    margin: 0 0 6px;
    color: var(--dark-color);
    font-size: 20px;
}

.simple-user-panel p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.simple-user-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 108px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.kpi-card.attention {
    border-color: #f5c66a;
}

.kpi-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.kpi-card strong {
    color: var(--dark-color);
    font-size: 26px;
    line-height: 1;
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 18px;
}

.kpi-icon.blue { color: #1d4ed8; background: #dbeafe; }
.kpi-icon.green { color: #15803d; background: #dcfce7; }
.kpi-icon.orange { color: #b45309; background: #fef3c7; }
.kpi-icon.dark { color: #334155; background: #e2e8f0; }

.dashboard-main-grid,
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-bottom-grid {
    grid-template-columns: 1.35fr 1fr;
}

.dashboard-panel {
    min-width: 0;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.panel-heading h2 {
    margin: 0 0 5px;
    color: var(--dark-color);
    font-size: 18px;
}

.panel-heading span {
    color: var(--text-muted);
    font-size: 12px;
}

.panel-heading > i {
    color: var(--primary-color);
    font-size: 20px;
}

.panel-link {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.panel-link:hover { color: var(--primary-dark); }

.dashboard-chart {
    height: 265px;
}

.stock-alert-list,
.movement-list,
.consumption-list {
    display: flex;
    flex-direction: column;
}

.stock-alert-row,
.movement-row,
.consumption-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--gray-200);
}

.stock-alert-row:last-child,
.movement-row:last-child,
.consumption-row:last-child { border-bottom: 0; }

.stock-alert-row > div:first-child,
.movement-info,
.consumption-info {
    min-width: 0;
    flex: 1;
}

.stock-alert-row strong,
.movement-info strong,
.consumption-info strong {
    display: block;
    overflow: hidden;
    color: var(--dark-color);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-alert-row span,
.movement-info span,
.consumption-info span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.stock-level {
    text-align: right;
    white-space: nowrap;
}

.stock-level strong { display: inline; color: var(--warning-color); font-size: 16px; }
.stock-level span { display: inline; margin-left: 3px; }

.movement-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
}

.movement-icon.incoming { color: #15803d; background: #dcfce7; }
.movement-icon.outgoing { color: #b45309; background: #fef3c7; }

.movement-value { text-align: right; font-size: 14px; font-weight: 800; white-space: nowrap; }
.movement-value small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 500; }
.incoming-text { color: #15803d; }
.outgoing-text { color: #b45309; }

.rank { width: 26px; color: var(--primary-color); font-size: 12px; font-weight: 800; }
.consumption-total { color: var(--dark-color); font-size: 14px; }

.empty-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 170px;
    gap: 6px;
    color: var(--text-muted);
    text-align: center;
}

.empty-panel i { margin-bottom: 6px; color: var(--success-color); font-size: 28px; }
.empty-panel strong { color: var(--dark-color); font-size: 14px; }
.empty-panel span { font-size: 12px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .page-content {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-main-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }

    .history-table-wrap .data-table {
        min-width: 0;
        table-layout: fixed;
    }

    .history-table-wrap .data-table th,
    .history-table-wrap .data-table td {
        overflow-wrap: anywhere;
    }

    .history-table-wrap .data-table th:last-child,
    .history-table-wrap .data-table td:last-child {
        width: 104px;
    }
}

@media (max-width: 768px) {
    .login-page {
        align-items: center;
        padding: 12px;
    }

    .login-box {
        padding: 24px 20px 16px;
    }

    .login-header {
        margin-bottom: 18px;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
    }

    .app-container.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-content {
        padding: 16px 12px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    
    .page-title {
        font-size: 24px;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions .btn {
        flex: 1;
    }

    .simple-user-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .simple-user-actions {
        width: 100%;
    }

    .simple-user-actions .btn {
        flex: 1;
    }

    .report-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .report-filters {
        grid-template-columns: 1fr;
    }

    .report-filter-actions {
        padding-bottom: 0;
    }

    .report-summary {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 16px 24px;
    }

    .report-actions {
        width: 100%;
        margin-left: 0;
    }

    .history-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-heading .btn {
        width: 100%;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .history-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .history-toolbar .history-filters {
        grid-template-columns: 1fr;
    }

    .history-toolbar,
    .history-table-wrap {
        border-radius: var(--border-radius-sm);
    }

    .history-toolbar {
        padding: 12px;
    }

    .history-toolbar .card-header,
    .history-table-wrap .card-header {
        padding: 16px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .history-toolbar .card-body,
    .history-table-wrap .card-body {
        padding: 12px;
    }

    .filter-actions {
        padding-bottom: 0;
    }

    .history-summary {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px 24px;
    }

    .summary-actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .summary-actions .btn,
    .filter-actions .btn {
        flex: 1 1 140px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .product-summary {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px 24px;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .product-form-body {
        padding: 24px 20px;
    }

    .user-form-body {
        padding: 24px 20px;
    }

    .users-table-wrap .data-table {
        min-width: 700px;
    }

    .product-form-body .form-row {
        grid-template-columns: 1fr;
    }

    .inventory-selector {
        grid-template-columns: 1fr;
    }

    .inventory-selector .btn {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }

    .history-table-wrap .data-table {
        min-width: 760px;
    }

    .history-table-wrap::-webkit-scrollbar,
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .history-table-wrap::-webkit-scrollbar-thumb,
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 8px;
    }
    
    .top-bar {
        padding: 0 16px;
        gap: 12px;
    }
    
    .top-bar-right {
        gap: 8px;
        overflow: hidden;
    }

    .user-menu {
        min-width: 0;
    }

    .user-name,
    .user-role {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-header,
    .card-body {
        min-width: 0;
    }

    .btn {
        max-width: 100%;
        white-space: normal;
    }

    .modal-content {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        margin: 12px auto;
    }

    .modal-content.wide {
        width: calc(100% - 24px);
        margin: 12px auto;
    }

    .modal-header {
        padding: 18px 20px;
    }
}

@media (min-width: 769px) and (max-height: 760px) {
    .login-page {
        align-items: center;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .login-container {
        margin: 0 auto;
        transform: scale(0.92);
        transform-origin: center center;
    }
}

@media print {
    .no-print,
    .sidebar,
    .top-bar,
    .page-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 0;
        max-width: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

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

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