/* ============================================
   TRANSLINE LOGISTIK - Sendungsverwaltung
   Corporate Design: Rot / Grau / Schwarz
   ============================================ */

/* === THEME OVERRIDE RESET === */
#tl-app.tl-app,
#tl-app.tl-app * {
    box-sizing: border-box;
}

#tl-app.tl-app img {
    max-width: 100%;
}

#tl-app .tl-header img.tl-header-logo {
    height: 36px !important;
    max-height: 36px !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain !important;
}

#tl-app .tl-search-box {
    position: relative !important;
}

#tl-app .tl-search-box > i {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    pointer-events: none !important;
    font-size: 14px !important;
    color: var(--tl-gray-400) !important;
    margin: 0 !important;
    padding: 0 !important;
}

#tl-app .tl-search-box input {
    padding-left: 40px !important;
}
/* === END THEME RESET === */

:root {
    --tl-red: #CC2229;
    --tl-red-dark: #A51B21;
    --tl-red-light: #E8444A;
    --tl-gray-900: #1A1A1A;
    --tl-gray-800: #2D2D2D;
    --tl-gray-700: #3D3D3D;
    --tl-gray-600: #555555;
    --tl-gray-500: #777777;
    --tl-gray-400: #999999;
    --tl-gray-300: #BBBBBB;
    --tl-gray-200: #DDDDDD;
    --tl-gray-100: #EEEEEE;
    --tl-gray-50: #F5F5F5;
    --tl-white: #FFFFFF;
    --tl-black: #000000;

    --tl-success: #27AE60;
    --tl-warning: #F39C12;
    --tl-danger: #E74C3C;
    --tl-info: #2980B9;
    --tl-accent: #8E44AD;

    --tl-font-display: 'Red Hat Display', -apple-system, BlinkMacSystemFont, sans-serif;
    --tl-font-body: 'Red Hat Text', -apple-system, BlinkMacSystemFont, sans-serif;

    --tl-sidebar-width: 240px;
    --tl-header-height: 60px;
    --tl-radius: 8px;
    --tl-radius-sm: 4px;
    --tl-radius-lg: 12px;
    --tl-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --tl-shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    --tl-transition: 0.2s ease;
}

/* ===== RESET & BASE ===== */
.tl-app, .tl-app * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tl-app {
    font-family: var(--tl-font-body);
    font-size: 14px;
    color: var(--tl-gray-800);
    background: var(--tl-gray-50);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.tl-app a { color: var(--tl-red); text-decoration: none; }
.tl-app a:hover { color: var(--tl-red-dark); }

/* ===== LOGIN ===== */
.tl-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--tl-gray-900) 0%, var(--tl-gray-800) 50%, var(--tl-red-dark) 100%);
    padding: 20px;
}

.tl-login-box {
    width: 100%;
    max-width: 420px;
    background: var(--tl-white);
    border-radius: var(--tl-radius-lg);
    box-shadow: var(--tl-shadow-lg);
    overflow: hidden;
}

.tl-login-header {
    background: var(--tl-gray-900);
    padding: 30px;
    text-align: center;
}

.tl-login-logo {
    max-width: 220px;
    height: auto;
}

.tl-login-subtitle {
    color: var(--tl-gray-400);
    font-family: var(--tl-font-display);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 10px;
}

.tl-login-form {
    padding: 30px;
}

.tl-login-footer {
    padding: 15px 30px;
    background: var(--tl-gray-50);
    text-align: center;
    font-size: 12px;
    color: var(--tl-gray-500);
}

/* ===== FORM ELEMENTS ===== */
.tl-form-group {
    margin-bottom: 16px;
}

.tl-form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tl-gray-600);
    margin-bottom: 6px;
}

.tl-form-group label i {
    margin-right: 4px;
    color: var(--tl-red);
}

.tl-form-group input,
.tl-form-group select,
.tl-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--tl-gray-200);
    border-radius: var(--tl-radius);
    font-family: var(--tl-font-body);
    font-size: 14px;
    color: var(--tl-gray-800);
    background: var(--tl-white);
    transition: border-color var(--tl-transition), box-shadow var(--tl-transition);
    outline: none;
}

.tl-form-group input:focus,
.tl-form-group select:focus,
.tl-form-group textarea:focus {
    border-color: var(--tl-red);
    box-shadow: 0 0 0 3px rgba(204,34,41,0.1);
}

.tl-form-group input::placeholder {
    color: var(--tl-gray-400);
}

.tl-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

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

.tl-form-section {
    background: var(--tl-gray-50);
    border-radius: var(--tl-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.tl-form-section h4 {
    font-family: var(--tl-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--tl-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tl-red);
}

.tl-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.tl-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tl-red);
}

/* ===== BUTTONS ===== */
.tl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--tl-radius);
    font-family: var(--tl-font-display);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tl-transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}

.tl-btn i { font-size: 14px; }

.tl-btn-primary {
    background: var(--tl-red);
    color: var(--tl-white);
}
.tl-btn-primary:hover {
    background: var(--tl-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(204,34,41,0.3);
}

.tl-btn-secondary {
    background: var(--tl-gray-700);
    color: var(--tl-white);
}
.tl-btn-secondary:hover { background: var(--tl-gray-800); }

.tl-btn-success {
    background: var(--tl-success);
    color: var(--tl-white);
}
.tl-btn-success:hover { background: #219a52; }

.tl-btn-danger {
    background: var(--tl-danger);
    color: var(--tl-white);
}
.tl-btn-danger:hover { background: #c0392b; }

.tl-btn-accent {
    background: var(--tl-accent);
    color: var(--tl-white);
}
.tl-btn-accent:hover { background: #7d3c98; }

.tl-btn-outline {
    background: transparent;
    border-color: var(--tl-gray-300);
    color: var(--tl-gray-600);
}
.tl-btn-outline:hover {
    border-color: var(--tl-red);
    color: var(--tl-red);
}

.tl-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.tl-btn-sm i { font-size: 12px; }

.tl-btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
}

.tl-btn-icon {
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--tl-gray-500);
    cursor: pointer;
    border-radius: var(--tl-radius-sm);
    transition: all var(--tl-transition);
}
.tl-btn-icon:hover { background: var(--tl-gray-100); color: var(--tl-gray-800); }
.tl-btn-icon.tl-btn-icon-danger:hover { color: var(--tl-danger); background: #fef2f2; }
.tl-btn-icon.tl-btn-icon-edit:hover { color: var(--tl-info); background: #eff6ff; }

/* ===== HEADER ===== */
.tl-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tl-header-height);
    max-height: var(--tl-header-height);
    overflow: hidden;
    background: var(--tl-gray-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.tl-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    max-height: 100%;
}

.tl-menu-toggle {
    background: transparent;
    border: none;
    color: var(--tl-white);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--tl-radius-sm);
    display: none;
}
.tl-menu-toggle:hover { background: rgba(255,255,255,0.1); }

.tl-header-logo {
    height: 36px !important;
    max-height: 36px !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain !important;
    display: block;
}

.tl-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tl-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tl-gray-300);
    font-size: 13px;
}

.tl-user-info i { font-size: 24px; color: var(--tl-red); }

.tl-user-name {
    font-weight: 600;
    color: var(--tl-white);
}

.tl-user-role {
    font-size: 11px;
    background: var(--tl-red);
    color: var(--tl-white);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

#tl-logout-btn {
    color: var(--tl-gray-400);
    border-color: var(--tl-gray-600);
}
#tl-logout-btn:hover {
    color: var(--tl-red-light);
    border-color: var(--tl-red);
}

/* ===== SIDEBAR ===== */
.tl-sidebar {
    position: fixed;
    top: var(--tl-header-height);
    left: 0;
    bottom: 0;
    width: var(--tl-sidebar-width);
    background: var(--tl-white);
    border-right: 1px solid var(--tl-gray-200);
    overflow-y: auto;
    z-index: 900;
    transition: transform var(--tl-transition);
}

.tl-sidebar-inner {
    padding: 16px 0;
}

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

.tl-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--tl-gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--tl-transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.tl-nav-item a:hover {
    background: var(--tl-gray-50);
    color: var(--tl-gray-800);
}

.tl-nav-item.active a {
    background: rgba(204,34,41,0.06);
    color: var(--tl-red);
    border-left-color: var(--tl-red);
    font-weight: 700;
}

.tl-nav-item a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.tl-nav-divider {
    height: 1px;
    background: var(--tl-gray-200);
    margin: 12px 20px;
}

/* ===== MAIN CONTENT ===== */
.tl-main {
    margin-left: var(--tl-sidebar-width);
    margin-top: var(--tl-header-height);
    min-height: calc(100vh - var(--tl-header-height));
    padding: 24px;
}

.tl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.tl-page-header h2 {
    font-family: var(--tl-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--tl-gray-900);
}

.tl-page-header h2 i {
    color: var(--tl-red);
    margin-right: 8px;
}

.tl-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== STATS GRID ===== */
.tl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.tl-stat-card {
    background: var(--tl-white);
    border-radius: var(--tl-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--tl-shadow);
    border-left: 4px solid var(--tl-gray-300);
    transition: transform var(--tl-transition), box-shadow var(--tl-transition);
}

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

.tl-stat-primary { border-left-color: var(--tl-red); }
.tl-stat-success { border-left-color: var(--tl-success); }
.tl-stat-warning { border-left-color: var(--tl-warning); }
.tl-stat-info { border-left-color: var(--tl-info); }
.tl-stat-accent { border-left-color: var(--tl-accent); }

.tl-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tl-radius);
    background: var(--tl-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--tl-gray-500);
    flex-shrink: 0;
}

.tl-stat-primary .tl-stat-icon { background: rgba(204,34,41,0.08); color: var(--tl-red); }
.tl-stat-success .tl-stat-icon { background: rgba(39,174,96,0.08); color: var(--tl-success); }
.tl-stat-warning .tl-stat-icon { background: rgba(243,156,18,0.08); color: var(--tl-warning); }
.tl-stat-info .tl-stat-icon { background: rgba(41,128,185,0.08); color: var(--tl-info); }
.tl-stat-accent .tl-stat-icon { background: rgba(142,68,173,0.08); color: var(--tl-accent); }

.tl-stat-value {
    display: block;
    font-family: var(--tl-font-display);
    font-size: 26px;
    font-weight: 900;
    color: var(--tl-gray-900);
    line-height: 1;
}

.tl-stat-label {
    display: block;
    font-size: 12px;
    color: var(--tl-gray-500);
    margin-top: 4px;
}

/* ===== QUICK ACTIONS ===== */
.tl-quick-actions h3 {
    font-family: var(--tl-font-display);
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--tl-gray-700);
}

.tl-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.tl-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--tl-white);
    border: 2px solid var(--tl-gray-200);
    border-radius: var(--tl-radius);
    cursor: pointer;
    transition: all var(--tl-transition);
    font-family: var(--tl-font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--tl-gray-700);
}

.tl-action-btn i {
    font-size: 28px;
    color: var(--tl-red);
}

.tl-action-btn:hover {
    border-color: var(--tl-red);
    background: rgba(204,34,41,0.03);
    transform: translateY(-2px);
    box-shadow: var(--tl-shadow);
}

/* ===== FILTERS ===== */
.tl-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.tl-search-box {
    position: relative !important;
    flex: 1;
    min-width: 250px;
}

.tl-search-box > i,
.tl-search-box > .fas,
.tl-search-box > .fa-search {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--tl-gray-400);
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.tl-search-box input,
.tl-search-box input[type="text"] {
    width: 100% !important;
    padding: 10px 14px 10px 40px !important;
    border: 2px solid var(--tl-gray-200);
    border-radius: var(--tl-radius);
    font-family: var(--tl-font-body);
    font-size: 14px;
    outline: none;
    transition: border-color var(--tl-transition);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.tl-search-box input:focus {
    border-color: var(--tl-red);
}

.tl-filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tl-filter-group select,
.tl-filter-group input[type="date"] {
    padding: 10px 14px;
    border: 2px solid var(--tl-gray-200);
    border-radius: var(--tl-radius);
    font-family: var(--tl-font-body);
    font-size: 13px;
    outline: none;
    background: var(--tl-white);
    color: var(--tl-gray-700);
}

/* ===== TABLES ===== */
.tl-table-wrapper {
    background: var(--tl-white);
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
    overflow-x: auto;
}

.tl-table {
    width: 100%;
    border-collapse: collapse;
}

.tl-table thead th {
    background: var(--tl-gray-900);
    color: var(--tl-white);
    padding: 12px 16px;
    font-family: var(--tl-font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.tl-table thead th.tl-sortable {
    cursor: pointer;
    user-select: none;
}

.tl-table thead th.tl-sortable:hover {
    background: var(--tl-gray-800);
}

.tl-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--tl-gray-100);
    font-size: 13px;
    vertical-align: middle;
}

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

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

.tl-loading-cell {
    text-align: center;
    padding: 40px !important;
}

/* Status-Badge */
.tl-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.tl-badge-active {
    background: rgba(39,174,96,0.1);
    color: var(--tl-success);
}

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

.tl-badge-hub {
    background: rgba(142,68,173,0.1);
    color: var(--tl-accent);
}

/* ===== PAGINATION ===== */
.tl-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.tl-pagination button {
    padding: 6px 12px;
    border: 1px solid var(--tl-gray-200);
    border-radius: var(--tl-radius-sm);
    background: var(--tl-white);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--tl-transition);
}

.tl-pagination button:hover {
    border-color: var(--tl-red);
    color: var(--tl-red);
}

.tl-pagination button.active {
    background: var(--tl-red);
    color: var(--tl-white);
    border-color: var(--tl-red);
}

/* ===== SCANNER ===== */
.tl-scanner-container {
    max-width: 800px;
}

.tl-scanner-input-area {
    background: var(--tl-white);
    border-radius: var(--tl-radius);
    padding: 24px;
    box-shadow: var(--tl-shadow);
    margin-bottom: 20px;
}

.tl-scan-type-selector {
    margin-bottom: 20px;
}

.tl-scan-type-selector label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tl-gray-600);
    margin-bottom: 10px;
}

.tl-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tl-radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid var(--tl-gray-200);
    border-radius: var(--tl-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--tl-transition);
    background: var(--tl-white);
}

.tl-radio-btn:hover {
    border-color: var(--tl-gray-400);
}

.tl-radio-btn.active {
    border-color: var(--tl-red);
    background: rgba(204,34,41,0.05);
    color: var(--tl-red);
}

.tl-radio-btn input { display: none; }

.tl-scanner-field {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.tl-scanner-field > i {
    font-size: 24px;
    color: var(--tl-red);
}

.tl-scanner-field input {
    flex: 1;
    padding: 14px 18px;
    border: 3px solid var(--tl-red);
    border-radius: var(--tl-radius);
    font-size: 18px;
    font-family: var(--tl-font-display);
    font-weight: 600;
    outline: none;
}

.tl-scanner-field input:focus {
    box-shadow: 0 0 0 4px rgba(204,34,41,0.15);
}

.tl-scanner-result {
    background: var(--tl-white);
    border-radius: var(--tl-radius);
    padding: 24px;
    box-shadow: var(--tl-shadow);
}

.tl-scan-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tl-gray-100);
}

.tl-scan-result-header i {
    font-size: 32px;
}

.tl-scan-result-header h3 {
    font-family: var(--tl-font-display);
    font-size: 18px;
}

.tl-scan-history {
    margin-top: 20px;
}

.tl-scan-history h4 {
    font-size: 14px;
    color: var(--tl-gray-600);
    margin-bottom: 10px;
}

.tl-timeline {
    position: relative;
    padding-left: 24px;
}

.tl-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--tl-gray-200);
}

.tl-timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.tl-timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--tl-red);
    border: 2px solid var(--tl-white);
}

.tl-timeline-item .tl-time {
    font-size: 11px;
    color: var(--tl-gray-500);
}

.tl-timeline-item .tl-event {
    font-weight: 600;
    font-size: 13px;
}

/* ===== MODAL ===== */
.tl-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.tl-modal {
    background: var(--tl-white);
    border-radius: var(--tl-radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: tl-modal-in 0.2s ease-out;
}

@keyframes tl-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--tl-gray-900);
    color: var(--tl-white);
}

.tl-modal-header h3 {
    font-family: var(--tl-font-display);
    font-size: 16px;
    font-weight: 700;
}

.tl-modal-close {
    background: transparent;
    border: none;
    color: var(--tl-gray-400);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--tl-radius-sm);
}
.tl-modal-close:hover { color: var(--tl-white); background: rgba(255,255,255,0.1); }

.tl-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tl-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--tl-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tl-modal.tl-modal-wide { max-width: 1000px; }

/* ===== TOAST ===== */
.tl-toast-container {
    position: fixed;
    top: calc(var(--tl-header-height) + 12px);
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tl-toast {
    padding: 12px 20px;
    border-radius: var(--tl-radius);
    color: var(--tl-white);
    font-weight: 500;
    font-size: 13px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--tl-shadow-lg);
    animation: tl-toast-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tl-toast-success { background: var(--tl-success); }
.tl-toast-error { background: var(--tl-danger); }
.tl-toast-warning { background: var(--tl-warning); }
.tl-toast-info { background: var(--tl-info); }

@keyframes tl-toast-in {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== ALERTS ===== */
.tl-alert {
    padding: 12px 16px;
    border-radius: var(--tl-radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.tl-alert-error {
    background: #fef2f2;
    color: var(--tl-danger);
    border: 1px solid rgba(231,76,60,0.2);
}

.tl-alert-success {
    background: #f0fdf4;
    color: var(--tl-success);
    border: 1px solid rgba(39,174,96,0.2);
}

/* ===== SPINNER ===== */
.tl-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--tl-gray-200);
    border-top-color: var(--tl-red);
    border-radius: 50%;
    animation: tl-spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes tl-spin {
    to { transform: rotate(360deg); }
}

.tl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--tl-gray-500);
}

/* ===== BACKUP SETTINGS ===== */
.tl-backup-settings-card {
    background: var(--tl-white);
    border-radius: var(--tl-radius);
    padding: 24px;
    box-shadow: var(--tl-shadow);
    margin-bottom: 24px;
}

.tl-backup-settings-card h3 {
    font-family: var(--tl-font-display);
    font-size: 16px;
    color: var(--tl-gray-800);
    margin-bottom: 20px;
}

.tl-backup-settings-card h3 i {
    color: var(--tl-red);
    margin-right: 6px;
}

/* ===== CAMERA SCANNER ===== */
.tl-scanner-camera {
    margin: 16px 0;
    position: relative;
    border-radius: var(--tl-radius);
    overflow: hidden;
}

.tl-scanner-camera video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.tl-scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 60px;
    border: 3px solid var(--tl-red);
    border-radius: var(--tl-radius);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .tl-menu-toggle { display: block; }

    .tl-sidebar {
        transform: translateX(-100%);
    }

    .tl-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }

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

    .tl-user-name, .tl-user-role { display: none; }

    .tl-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .tl-main { padding: 16px; }

    .tl-page-header { flex-direction: column; align-items: flex-start; }

    .tl-filters { flex-direction: column; }

    .tl-search-box { min-width: 100%; }

    .tl-filter-group { width: 100%; }

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

    .tl-table thead th,
    .tl-table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tl-scanner-field {
        flex-direction: column;
    }

    .tl-scanner-field input {
        width: 100%;
    }

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

    .tl-modal {
        max-height: 95vh;
        border-radius: var(--tl-radius);
    }

    .tl-modal-overlay {
        padding: 10px;
    }

    .tl-stat-card {
        padding: 14px;
    }

    .tl-stat-value {
        font-size: 20px;
    }

    .tl-header-actions {
        width: 100%;
    }

    .tl-header-actions .tl-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tl-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tl-action-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tl-action-btn {
        padding: 16px 12px;
    }

    .tl-action-btn i {
        font-size: 22px;
    }
}

/* ===== EMPTY STATE ===== */
.tl-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tl-gray-500);
}

.tl-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--tl-gray-300);
}

.tl-empty p {
    font-size: 14px;
}

/* ===== DETAIL VIEW ===== */
.tl-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tl-detail-grid dt {
    font-size: 12px;
    color: var(--tl-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tl-detail-grid dd {
    font-weight: 600;
    margin-bottom: 8px;
}

/* ===== CONFIRM DIALOG ===== */
.tl-confirm-msg {
    text-align: center;
    padding: 20px;
}

.tl-confirm-msg i {
    font-size: 48px;
    color: var(--tl-warning);
    margin-bottom: 16px;
}

.tl-confirm-msg p {
    font-size: 15px;
    color: var(--tl-gray-700);
}

/* === ADDITIONAL STYLES v1.1 === */

/* Detail Grid (POD, Scanner result) */
.tl-detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 16px 0; font-size: 14px; }
.tl-detail-grid dt { font-weight: 600; color: var(--tl-gray-600); }
.tl-detail-grid dd { color: var(--tl-gray-800); }

/* Confirm Dialog */
.tl-confirm-msg { text-align: center; padding: 20px 0; }
.tl-confirm-msg i { font-size: 48px; color: var(--tl-warning); margin-bottom: 12px; display: block; }
.tl-confirm-msg p { font-size: 16px; color: var(--tl-gray-700); }

/* Import Preview */
#tl-import-preview-table table { font-size: 11px !important; }
#tl-import-preview-table th { background: var(--tl-gray-200) !important; color: var(--tl-gray-700) !important; padding: 4px 8px !important; font-size: 10px !important; }
#tl-import-preview-table td { padding: 3px 8px !important; font-size: 11px !important; }

/* Form Section */
.tl-form-section { border: 1px solid var(--tl-gray-200); border-radius: 8px; padding: 16px; margin-bottom: 16px; background: var(--tl-gray-50); }
.tl-form-section h4 { font-size: 14px; font-weight: 600; color: var(--tl-red); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--tl-gray-200); }
.tl-form-section h4 i { margin-right: 6px; }

/* POD Canvas */
#tl-pod-canvas { background: #fff; }

/* Scan result header */
.tl-scan-result-header { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--tl-gray-50); border-radius: 8px; margin-bottom: 16px; }
.tl-scan-result-header h3 { margin: 0; font-size: 18px; }
.tl-scan-result-header p { margin: 4px 0 0; color: var(--tl-gray-500); font-size: 13px; }

/* Scan history */
.tl-scan-history { margin-top: 16px; }
.tl-scan-history h4 { font-size: 14px; color: var(--tl-gray-700); margin-bottom: 12px; }
.tl-timeline { padding-left: 16px; border-left: 2px solid var(--tl-gray-200); }
.tl-timeline-item { padding: 8px 0 8px 16px; position: relative; }
.tl-timeline-item::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--tl-red); position: absolute; left: -22px; top: 14px; }
.tl-timeline-item .tl-event { font-weight: 600; font-size: 13px; }
.tl-timeline-item .tl-time { font-size: 12px; color: var(--tl-gray-500); }

/* Loading state */
.tl-loading { text-align: center; padding: 40px; }
.tl-loading-cell { text-align: center !important; padding: 40px !important; }

/* Hub Badge */
.tl-badge-hub { background: var(--tl-warning) !important; color: #fff !important; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.tl-badge-active { background: var(--tl-success) !important; color: #fff !important; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.tl-badge-inactive { background: var(--tl-gray-400) !important; color: #fff !important; font-size: 11px; padding: 2px 8px; border-radius: 4px; }

/* Button icon variants */
.tl-btn-icon { background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; color: var(--tl-gray-500); transition: all .15s; font-size: 14px; }
.tl-btn-icon:hover { background: var(--tl-gray-100); color: var(--tl-gray-800); }
.tl-btn-icon-edit:hover { color: var(--tl-info); }
.tl-btn-icon-danger:hover { color: var(--tl-danger); background: rgba(231,76,60,.08); }

/* Actions cell */
.tl-actions-cell { white-space: nowrap; }

/* Checkbox label */
.tl-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.tl-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--tl-red); cursor: pointer; }

/* Small button */
.tl-btn-sm { padding: 4px 10px; font-size: 12px; }

/* Wide Modal */
.tl-modal-wide .tl-modal { max-width: 800px; }

/* Radio buttons for scanner */
.tl-radio-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--tl-gray-200); border-radius: 8px; cursor: pointer; transition: all .15s; font-size: 13px; font-weight: 500; margin: 0 4px 4px 0; }
.tl-radio-btn input { display: none; }
.tl-radio-btn:hover { border-color: var(--tl-gray-400); }
.tl-radio-btn.active { border-color: var(--tl-red); background: rgba(204,34,41,.05); color: var(--tl-red); }

/* Action grid (Dashboard) */
.tl-action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tl-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; background: var(--tl-gray-50); border: 2px solid var(--tl-gray-200); border-radius: 10px; cursor: pointer; transition: all .2s; font-size: 13px; font-weight: 500; color: var(--tl-gray-700); }
.tl-action-btn i { font-size: 22px; color: var(--tl-red); }
.tl-action-btn:hover { border-color: var(--tl-red); background: rgba(204,34,41,.04); transform: translateY(-2px); }

@media (max-width: 768px) {
    .tl-action-grid { grid-template-columns: repeat(2, 1fr); }
    .tl-detail-grid { grid-template-columns: 100px 1fr; }
}
