/*
 * ============================================================================
 * BURGUT LOGISTICS — ADMIN PANEL UI SYSTEM
 * Version: 3.0 — Premium Polish
 * Description: Единая дизайн-система для админ-панели
 * ============================================================================
 */

/* ============================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================================ */
:root {
    /* --- COLOR PALETTE --- */
    /* Primary - Modern Indigo */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --primary-rgb: 79, 70, 229;

    /* Secondary - Cool Gray */
    --secondary: #475569;
    --secondary-light: #64748b;
    --secondary-dark: #334155;

    /* Success - Emerald */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --success-bg: #d1fae5;

    /* Danger - Red */
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #dc2626;
    --danger-bg: #fee2e2;

    /* Warning - Amber */
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;
    --warning-bg: #fef3c7;

    /* Info - Blue */
    --info: #3b82f6;
    --info-light: #60a5fa;
    --info-dark: #2563eb;
    --info-bg: #dbeafe;

    /* Neutrals */
    --white: #ffffff;
    --light: #f8fafc;
    --light-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
}

/* ============================================================================
   2. RESET & BASE STYLES
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text);
    background-color: var(--body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    min-height: 100vh;
}

/* Typography */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-weight: 600;
    color: var(--text);
    margin-top: 0;
    line-height: 1.3;
}

h1, .h1 { font-size: var(--text-2xl); margin-bottom: 1.5rem; }
h2, .h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
h3, .h3 { font-size: 1.125rem; margin-bottom: 1rem; }
h4, .h4 { font-size: 1rem; margin-bottom: 0.75rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    background-color: var(--light);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 85%;
    color: var(--text);
    border: 1px solid var(--border);
}

strong {
    font-weight: 600;
    color: var(--text);
}

small {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================================================
   3. LAYOUT & NAVIGATION
   ============================================================================ */
/* Navbar */
.navbar {
    background-color: var(--white) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    padding: 0 var(--space-6);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    color: var(--text) !important;
    font-weight: 700;
    font-size: 1.125rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--primary);
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-details {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--secondary);
    font-weight: 500;
    font-size: var(--text-sm);
}

.user-details .feather {
    width: 1rem;
    height: 1rem;
    color: var(--secondary-light);
}

.logout-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
}

.logout-link:hover {
    background-color: var(--light);
    color: var(--text);
    text-decoration: none;
}

/* Sidebar */
.sidebar {
    background-color: var(--card-bg) !important;
    border-right: 1px solid var(--border);
    min-height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    padding: var(--space-4) 0;
}

.sidebar-heading {
    font-size: var(--text-xs);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-4);
}

.sidebar .nav-link {
    color: var(--secondary);
    font-weight: 500;
    font-size: var(--text-sm);
    border-radius: var(--radius-lg);
    margin: var(--space-1) var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar .nav-link .feather {
    color: var(--secondary-light);
    width: 1.125rem;
    height: 1.125rem;
    transition: color var(--transition-fast);
}

.sidebar .nav-link:hover {
    background-color: var(--light);
    color: var(--text);
    transform: translateX(4px);
}

.sidebar .nav-link:hover .feather {
    color: var(--primary);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.sidebar .nav-link.active .feather {
    color: var(--white);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--white);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* Main Content */
main {
    padding: var(--space-6) var(--space-8);
    min-height: calc(100vh - var(--header-height));
}

@media (max-width: 768px) {
    main {
        padding: var(--space-4);
    }
}

/* ============================================================================
   4. BUTTON COMPONENTS
   ============================================================================ */
.button-primary,
.button-secondary,
.button-danger,
.button-success,
.button-outline-success,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font-sans);
    transition: all var(--transition-base);
    text-align: center;
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.button-primary,
input[type="submit"] {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.button-primary:hover,
input[type="submit"]:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
    text-decoration: none;
}

.button-secondary {
    background-color: var(--white);
    color: var(--secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
    background-color: var(--light);
    border-color: var(--border-dark);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.button-danger {
    background-color: var(--danger);
    color: var(--white);
    border-color: var(--danger);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.button-danger:hover {
    background-color: var(--danger-dark);
    border-color: var(--danger-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
    text-decoration: none;
}

.button-success {
    background-color: var(--success);
    color: var(--white);
    border-color: var(--success);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.button-success:hover {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    text-decoration: none;
}

.button-outline-success {
    background-color: transparent;
    color: var(--success);
    border: 1px solid var(--success);
}

.button-outline-success:hover {
    background-color: var(--success);
    border-color: var(--success);
    color: var(--white);
    transform: translateY(-2px);
    text-decoration: none;
}

.button-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

.button-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

/* Button with icon */
[class*="button-"] .feather {
    width: 1rem;
    height: 1rem;
}

/* Button loading state */
.btn.is-loading,
.button-primary.is-loading,
.button-secondary.is-loading {
    pointer-events: none;
    opacity: 0.7;
    color: transparent !important;
    position: relative;
}

.btn.is-loading::after,
.button-primary.is-loading::after,
.button-secondary.is-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   5. FORM COMPONENTS
   ============================================================================ */
label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="file"],
textarea,
select,
.form-control,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text);
    background-color: var(--white);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-1);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover,
.form-control:hover,
.form-select:hover {
    border-color: var(--border-dark);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background-color: var(--white);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: var(--text-light);
}

input[type="text"]:disabled,
input[type="password"]:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled {
    background-color: var(--light);
    cursor: not-allowed;
    opacity: 0.6;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: var(--space-2);
    accent-color: var(--primary);
    cursor: pointer;
    vertical-align: middle;
}

input[type="checkbox"] + label,
input[type="radio"] + label {
    display: inline-block;
    margin-bottom: 0;
    cursor: pointer;
}

/* Form hints and errors */
.form-hint {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: -var(--space-1);
    margin-bottom: var(--space-3);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--danger);
    margin-top: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background-color: var(--danger-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--danger);
}

/* Input group */
.input-group {
    position: relative;
}

.input-group input {
    padding-left: 44px;
}

.input-group-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-group input:focus + .input-group-icon {
    color: var(--primary);
}

/* ============================================================================
   6. CARD COMPONENTS
   ============================================================================ */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card > h3:first-child,
.card > h2:first-child {
    margin-top: 0;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-4);
    color: var(--text);
    font-size: 1.125rem;
}

/* Card variants with colored left border */
.card[class*="border-left"] {
    border-left-width: 4px;
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
}

@media (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--card-bg);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card h3 {
    margin: 0;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.stat-card .number {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: var(--space-2);
    color: var(--text);
    line-height: 1;
}

/* ============================================================================
   7. TABLE COMPONENTS
   ============================================================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    min-width: 600px;
}

.table-container th,
.table-container td {
    padding: var(--space-4);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table-container thead th {
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    background-color: var(--light);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border);
    white-space: nowrap;
}

.table-container tbody tr {
    transition: background-color var(--transition-fast);
}

.table-container tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-container tbody tr:last-child td {
    border-bottom: none;
}

.table-container tbody tr:hover {
    background-color: var(--info-bg);
}

/* Sortable columns */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background var(--transition-fast);
}

th.sortable:hover {
    background: var(--light-hover);
}

th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    color: var(--text-light);
    font-size: 0.75rem;
}

th.sortable.asc::after {
    content: '↑';
    color: var(--primary);
}

th.sortable.desc::after {
    content: '↓';
    color: var(--primary);
}

/* Actions cell */
.actions-cell {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

/* Empty table message */
.empty-table-message {
    text-align: center;
    padding: var(--space-10) !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive tables */
@media (max-width: 768px) {
    .table-container table {
        min-width: 500px;
        font-size: var(--text-sm);
    }

    .table-container th,
    .table-container td {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .table-container table {
        min-width: 450px;
        font-size: var(--text-xs);
    }

    .table-container th,
    .table-container td {
        padding: var(--space-2);
    }

    .qty-col, .places-col, .cube-col, .weight-col {
        display: none;
    }
}

/* ============================================================================
   8. BADGE COMPONENTS
   ============================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
    color: var(--white);
    text-align: center;
    white-space: nowrap;
    border-radius: var(--radius-full);
}

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); }
.bg-info { background-color: var(--info); }
.bg-light { background-color: var(--light); color: var(--text); }

/* Badge variants for specific uses */
.badge-wh {
    background: var(--info-bg);
    color: var(--info-dark);
    border: 1px solid var(--info-light);
}

.badge-transit {
    background: var(--warning-bg);
    color: var(--warning-dark);
    border: 1px solid var(--warning-light);
}

/* ============================================================================
   9. ALERT COMPONENTS
   ============================================================================ */
.alert {
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert-success {
    color: #065f46;
    background-color: var(--success-bg);
    border-color: var(--success);
}

.alert-danger {
    color: #991b1b;
    background-color: var(--danger-bg);
    border-color: var(--danger);
}

.alert-info {
    color: #1e40af;
    background-color: var(--info-bg);
    border-color: var(--info);
}

.alert-warning {
    color: #92400e;
    background-color: var(--warning-bg);
    border-color: var(--warning);
}

/* Smart Alert (Premium) */
.smart-alert {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.smart-alert .alert-text {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: #92400e;
    font-weight: 500;
}

.smart-alert .alert-text i,
.smart-alert .alert-text .feather {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   10. PAGE HEADER & LAYOUT
   ============================================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.page-title {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
}

.page-subtitle {
    margin: var(--space-1) 0 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 400;
}

.page-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.page-actions .btn {
    margin: 0;
}

/* Section title */
.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.section-description {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: -var(--space-1);
    margin-bottom: var(--space-4);
}

/* Hint box */
.hint-box {
    background: var(--light);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Chip */
.chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--info-bg);
    color: var(--primary);
}

/* ============================================================================
   11. PAGINATION
   ============================================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--primary);
    border: 1px solid var(--border);
    background: var(--white);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.pagination .current {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}

/* ============================================================================
   12. LOGIN PAGE
   ============================================================================ */
.login-page {
    background: linear-gradient(135deg, var(--body-bg) 0%, var(--light) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-6);
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-10);
    width: 100%;
    max-width: 440px;
    border-top: 4px solid var(--primary);
}

.login-card h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: var(--space-6);
    font-size: var(--text-2xl);
    color: var(--text);
}

.login-card form > div {
    margin-bottom: var(--space-5);
}

.login-card label {
    font-size: var(--text-sm);
    color: var(--secondary);
}

.login-card input[type="text"],
.login-card input[type="password"] {
    margin-bottom: 0;
}

.login-card input[type="submit"] {
    margin-top: var(--space-4);
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
}

.login-card p {
    text-align: center;
    margin-top: var(--space-6);
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* ============================================================================
   13. LANGUAGE SWITCHER
   ============================================================================ */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--light);
}

.lang-switcher .lang-label {
    font-size: var(--text-xs);
    color: var(--secondary);
    font-weight: 600;
}

.lang-switcher .lang-buttons {
    display: flex;
    gap: var(--space-1);
}

.lang-switcher .lang-option {
    border: 1px solid var(--border);
    background: var(--white);
    padding: var(--space-1) var(--space-2);
    font-weight: 700;
    font-size: var(--text-xs);
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--secondary);
    transition: all var(--transition-fast);
    min-width: 36px;
    text-align: center;
}

.lang-switcher .lang-option:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.lang-switcher .lang-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ============================================================================
   14. TOAST NOTIFICATIONS (UX)
   ============================================================================ */
#toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: 9999;
}

.ux-toast {
    background: var(--white);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 320px;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform var(--transition-slow);
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--text);
    border-left: 4px solid;
}

.ux-toast.show {
    transform: translateX(0);
}

.ux-toast.success { border-left-color: var(--success); }
.ux-toast.error { border-left-color: var(--danger); }
.ux-toast.warning { border-left-color: var(--warning); }
.ux-toast.info { border-left-color: var(--info); }

.ux-toast .feather,
.ux-toast i {
    margin-top: 2px;
}

.ux-toast.success .feather { color: var(--success); }
.ux-toast.error .feather { color: var(--danger); }
.ux-toast.warning .feather { color: var(--warning); }
.ux-toast.info .feather { color: var(--info); }

/* ============================================================================
   15. MODAL & SIDE PANEL (UX)
   ============================================================================ */
.ux-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ux-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ux-modal {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-base);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ux-overlay.active .ux-modal {
    transform: translateY(0) scale(1);
}

.ux-side-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    background: var(--white);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.05);
}

.ux-overlay.active .ux-side-panel {
    transform: translateX(0);
}

.ux-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ux-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--text);
}

.ux-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.ux-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    background: var(--light);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

.ux-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.ux-close-btn:hover {
    color: var(--danger);
    background: var(--light);
}

/* ============================================================================
   16. PROGRESSIVE DISCLOSURE (Advanced Toggle)
   ============================================================================ */
.advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--info);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: var(--space-2) 0;
    margin-top: var(--space-2);
    transition: color var(--transition-fast);
}

.advanced-toggle:hover {
    color: var(--info-dark);
}

.advanced-toggle svg {
    transition: transform var(--transition-base);
}

.advanced-toggle.open svg {
    transform: rotate(180deg);
}

.advanced-fields {
    display: none;
    padding: var(--space-5);
    background: var(--light);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    margin-top: var(--space-2);
    gap: var(--space-4);
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}

.advanced-fields.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   17. DETAILS & HISTORY CARDS
   ============================================================================ */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-8);
}

@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.details-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.details-card li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.details-card li:last-child {
    border-bottom: none;
}

.details-card .label {
    font-weight: 600;
    color: var(--secondary);
    padding-right: var(--space-4);
    font-size: var(--text-sm);
}

.details-card .value {
    text-align: right;
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
}

.details-card li.highlight {
    background-color: var(--info-bg);
    margin: 0 calc(var(--space-6) * -1);
    padding: var(--space-3) var(--space-6);
    border-color: var(--info-light);
    border-radius: var(--radius-lg);
}

/* History Card */
.history-card .status-item {
    padding: var(--space-4);
    border-left: 4px solid var(--primary);
    margin-bottom: var(--space-4);
    background: var(--light);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.history-card .status-item:hover {
    transform: translateX(4px);
}

.history-card .status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.history-card .status-header strong {
    color: var(--text);
    font-size: var(--text-sm);
}

.history-card .status-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.history-card .status-text {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--secondary);
}

.history-card .status-comment {
    margin-top: var(--space-2);
    font-style: italic;
    color: var(--secondary);
    background-color: var(--border);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.history-card .status-comment strong {
    font-style: normal;
}

/* ============================================================================
   18. INVENTORY & SPECIAL SECTIONS
   ============================================================================ */
.inventory-section {
    margin-bottom: var(--space-8);
}

.inventory-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    background: var(--white);
    overflow: hidden;
}

.inventory-item-header {
    background-color: var(--light);
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--secondary);
}

.inventory-item-content .table-container {
    border: none;
    border-radius: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================================================
   19. UTILITY CLASSES
   ============================================================================ */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.small {
    font-size: var(--text-sm);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.ms-1 { margin-left: var(--space-1); }
.ms-2 { margin-left: var(--space-2); }
.ms-3 { margin-left: var(--space-3); }
.ms-4 { margin-left: var(--space-4); }

.me-1 { margin-right: var(--space-1); }
.me-2 { margin-right: var(--space-2); }
.me-3 { margin-right: var(--space-3); }
.me-4 { margin-right: var(--space-4); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }

.w-100 { width: 100%; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ============================================================================
   20. ANIMATIONS
   ============================================================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.3s ease forwards;
}

.animate-slide-in {
    animation: slideInRight 0.3s ease forwards;
}

/* ============================================================================
   21. ACCESSIBILITY
   ============================================================================ */
/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   22. PRINT STYLES
   ============================================================================ */
@media print {
    .no-print,
    .btn,
    [class*="button-"],
    input[type="submit"],
    #toast-container,
    .ux-overlay,
    header,
    nav,
    .sidebar,
    .pagination {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}
