html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/*Login*/

html, body {
    height: 100%;
}

body {
    background: radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 30%), radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.08), transparent 25%), linear-gradient(135deg, #f4f7fb 0%, #eef2f7 100%);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-card {
    width: 100%;
    max-width: 1180px;
    min-height: 720px;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}

.login-form-side {
    height: 100%;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #111827, #374151);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.brand-subtitle {
    font-size: 0.92rem;
    color: #6b7280;
}

.login-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.login-text {
    font-size: 1rem;
    line-height: 1.6;
}

.form-control {
    border-radius: 14px;
    border: 1px solid #d7dce3;
}

.form-floating > label {
    color: #6b7280;
}

.form-control:focus {
    border-color: #111827;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08);
}

.login-btn {
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.login-links a {
    color: #111827;
}

.login-info-side {
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, rgba(17,24,39,0.92), rgba(31,41,55,0.88)), url('/images/login-bg.jpg') center center / cover no-repeat;
    color: #fff;
    display: flex;
    align-items: flex-end;
}

.info-overlay {
    padding: 56px;
    width: 100%;
}

.info-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.info-text {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.82);
    max-width: 480px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
    color: rgba(255,255,255,0.92);
}

.feature-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.alert-danger {
    border-radius: 14px;
}

@media (max-width: 991.98px) {
    .login-card {
        min-height: auto;
        border-radius: 22px;
    }

    .login-form-side {
        padding: 32px 22px;
    }

    .login-title {
        font-size: 1.75rem;
    }
}



/*Layout*/

html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body.admin-body {
    margin: 0;
    min-height: 100vh;
    background: #f4f7fb;
    color: #111827;
}

/* NAVBAR */
.admin-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    min-height: 76px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 0;
    margin-right: 24px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #111827, #374151);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.18);
    flex-shrink: 0;
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

.admin-toggler {
    border: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f3f4f6;
    box-shadow: none !important;
}

    .admin-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08) !important;
    }

.admin-nav-list {
    gap: 6px;
}

.admin-nav-link {
    color: #374151 !important;
    font-weight: 600;
    padding: 10px 14px !important;
    border-radius: 12px;
    transition: all 0.2s ease;
}

    .admin-nav-link:hover,
    .admin-nav-link:focus {
        background: #eef2f7;
        color: #111827 !important;
    }

    .admin-nav-link.active {
        background: #111827;
        color: #fff !important;
    }

.admin-user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* PAGE */
.admin-page {
    min-height: calc(100vh - 140px);
}

.admin-main {
    padding-bottom: 40px;
}

/* FOOTER */
.admin-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    margin-top: 20px;
}

.admin-footer-inner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.95rem;
}

.admin-footer-link {
    text-decoration: none;
    color: #374151;
    font-weight: 600;
}

    .admin-footer-link:hover {
        color: #111827;
    }

/* MOBILE */
@media (max-width: 991.98px) {
    .admin-navbar {
        min-height: 70px;
    }

    .navbar-collapse {
        margin-top: 14px;
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 18px;
        padding: 14px;
        box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    }

    .admin-nav-list {
        gap: 2px;
    }

    .admin-nav-link {
        display: block;
        padding: 12px 14px !important;
        border-radius: 12px;
    }

    .admin-user-panel {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
    }

    .admin-footer-inner {
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 12px 0;
        text-align: center;
    }
}


/*Warehouse*/

.warehouse-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.warehouse-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.warehouse-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.warehouse-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
}

.warehouse-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.warehouse-stat-card,
.warehouse-filters-card,
.warehouse-table-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.warehouse-stat-card {
    padding: 18px 20px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.warehouse-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.warehouse-filters-card {
    padding: 20px;
    position: sticky;
    top: 0;
}

.warehouse-layout-3col > .warehouse-filters-card {
    max-height: calc(100vh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.warehouse-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 18px;
}

.warehouse-filter-form .form-control,
.warehouse-filter-form .form-select {
    border-radius: 12px;
    min-height: 44px;
}

.warehouse-filter-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.warehouse-filter-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-left: 4px;
    padding-right: 4px;
}

.warehouse-card-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.warehouse-table-card {
    padding: 0 18px 18px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    max-height: none;
}

.warehouse-layout-3col > .warehouse-table-card {
    position: static;
    top: auto;
}

.warehouse-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.warehouse-main-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.warehouse-add-action {
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
}

.warehouse-table-actions .btn {
    opacity: 1;
}

.warehouse-card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.warehouse-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    padding-right: 2px;
}

.warehouse-main-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
}

.warehouse-top-panel {
    position: static;
    top: auto;
    z-index: auto;
    background: #fff;
    margin: 0;
    padding: 20px 0 6px;
    padding-bottom: 6px;
    margin-bottom: 0;
    border-bottom: 1px solid #eef2f7;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.warehouse-results {
    color: #6b7280;
    font-size: 0.95rem;
}

.warehouse-table {
    margin-bottom: 0;
}

    .warehouse-table thead th {
        white-space: nowrap;
        background: #f8fafc;
        color: #374151;
        font-weight: 700;
        border-bottom: 1px solid #e5e7eb;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .warehouse-table tbody td {
        vertical-align: middle;
        padding-top: 14px;
        padding-bottom: 14px;
    }

.item-name {
    min-width: 210px;
    font-weight: 600;
    color: #111827;
}

.photo-badge {
    display: inline-flex;
    min-width: 46px;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

    .photo-badge.yes {
        background: #dcfce7;
        color: #166534;
    }

    .photo-badge.no {
        background: #f3f4f6;
        color: #6b7280;
    }

.stock-badge {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.stock-ok {
    background: #dcfce7;
    color: #166534;
}

.stock-low {
    background: #fef3c7;
    color: #92400e;
}

.stock-out {
    background: #fee2e2;
    color: #991b1b;
}

.stock-over {
    background: #dbeafe;
    color: #1d4ed8;
}

.stock-inactive {
    background: #e5e7eb;
    color: #374151;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sort-link {
    color: #111827;
    text-decoration: none;
}

    .sort-link:hover {
        color: #000;
        text-decoration: underline;
    }

.warehouse-pagination-wrap {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.pagination .page-link {
    border-radius: 10px !important;
    margin: 0 3px;
    color: #111827;
}

.pagination .page-item.active .page-link {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

@media (max-width: 1399.98px) {
    .warehouse-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .warehouse-layout {
        grid-template-columns: 1fr;
    }

    .warehouse-filters-card {
        position: static;
        top: auto;
    }

    .warehouse-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-add-action {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .warehouse-table-card {
        position: static;
        top: auto;
    }

    .warehouse-top-panel {
        position: static;
        top: auto;
        z-index: auto;
        padding: 0;
        padding-bottom: 0;
        margin: 0;
        margin-bottom: 0;
        border-bottom: 0;
    }

    .warehouse-table-scroll {
        overflow: visible;
    }
}

@media (max-width: 575.98px) {
    .warehouse-stats {
        grid-template-columns: 1fr;
    }

    .warehouse-title {
        font-size: 1.6rem;
    }

    .warehouse-table-card,
    .warehouse-filters-card {
        padding: 14px;
    }
}

.warehouse-layout-3col {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.filter-group {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 10px;
}

.filter-section-title {
    font-size: 1.18rem;
    font-weight: 900;
    margin-bottom: 0.55rem;
    letter-spacing: 0.01em;
}

.warehouse-filters-card .form-check-input:focus {
    border-color: #9ca3af;
    box-shadow: none;
}

.warehouse-filters-card .form-check-input:checked {
    background-color: #111827;
    border-color: #111827;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

    .filter-chip span {
        font-size: 1rem;
        line-height: 1;
    }

    .filter-chip:hover {
        background: #e0e7ff;
        color: #312e81;
    }

.warehouse-details-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    padding: 20px;
    position: sticky;
    top: 96px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.details-key-number {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.details-title {
    margin: 4px 0 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
}

.details-tabs {
    margin-bottom: 18px;
}

    .details-tabs .nav-link {
        border-radius: 12px !important;
        color: #374151;
        font-weight: 600;
    }

        .details-tabs .nav-link.active {
            background: #111827;
            color: #fff;
            border-color: #111827;
        }

.details-tab-content {
    padding-top: 4px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.96rem;
}

.details-section {
    margin-top: 22px;
}

.details-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}

.issue-form .form-control {
    border-radius: 12px;
    min-height: 44px;
}

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.issue-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.issue-worker {
    font-weight: 700;
    color: #111827;
}

.issue-date {
    font-size: 0.85rem;
    color: #6b7280;
}

.selected-row {
    background: #eef6ff;
    outline: 2px solid #93c5fd;
    outline-offset: -2px;
}

.warehouse-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

#keyDetailsModal .modal-dialog {
    max-width: 1200px;
}

#keyDetailsModal .modal-body {
    font-size: 1.06rem;
}

#keyDetailsModal .details-title {
    font-size: 1.6rem;
}

#keyDetailsModal .details-main-photo-wrap {
    max-height: 320px;
    aspect-ratio: 1 / 1;
}

#keyDetailsModal .details-main-photo-wrap.compact {
    max-height: 320px;
    aspect-ratio: 1 / 1;
}

.key-edit-layout {
    display: grid;
    grid-template-columns: 520px minmax(0, 1fr);
    gap: 22px;
}

.key-edit-right .form-label,
.key-edit-left .form-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.key-edit-right .form-control,
.key-edit-right .form-select,
.key-edit-left .form-control {
    font-size: 1.03rem;
    min-height: 42px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.advanced-fields {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fafc;
}

.advanced-fields > summary {
    cursor: pointer;
    font-weight: 700;
    color: #111827;
}

.digit-groups-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.digit-group-card {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 10px;
    background: #f8fafc;
}

.digit-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
}

.digit-group {
    display: flex;
    gap: 6px;
}

.digit-cell {
    width: 38px;
    height: 42px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: #14532d;
    border: 1px solid #86efac;
    border-radius: 8px;
    background: #f0fdf4;
}

.digit-cell:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.price-access-block {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 12px;
    background: #f8fbff;
}

.price-access-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 8px;
}

.price-access-checks {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.compatible-cars-block {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.compatible-inline-list {
    max-height: 180px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: #f9fafb;
}

.compatible-inline-item {
    font-size: 0.92rem;
    line-height: 1.35;
    padding: 4px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.compatible-inline-item:last-child {
    border-bottom: none;
}

.compatible-row {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

.compatible-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.compatible-edit {
    display: grid;
    grid-template-columns: 100px 100px auto auto;
    gap: 6px;
    align-items: center;
}

.compatible-edit .form-select,
.compatible-add .form-select,
.compatible-add .form-label {
    font-size: 1rem;
}

.compatible-add .btn {
    font-size: 0.98rem;
    font-weight: 600;
}

.compat-action-btn {
    font-size: 0.72rem;
    line-height: 1.1;
    padding: 0.2rem 0.4rem;
    min-height: 30px;
}

@media (max-width: 991.98px) {
    .key-edit-layout {
        grid-template-columns: 1fr;
    }

    .compatible-edit {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1399.98px) {
    .warehouse-layout-3col {
        grid-template-columns: 330px minmax(0, 1fr);
    }

    .warehouse-details-card {
        grid-column: 1 / -1;
        position: static;
        top: auto;
    }
}

@media (max-width: 991.98px) {
    .warehouse-layout-3col {
        grid-template-columns: 1fr;
    }

    .warehouse-details-card,
    .warehouse-filters-card {
        position: static;
        top: auto;
    }

    .warehouse-layout-3col > .warehouse-filters-card {
        position: static;
        top: auto;
        max-height: none;
    }
}

.details-photo-section {
    margin-bottom: 20px;
}

.details-main-photo-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.details-main-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.details-photo-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.details-thumb-btn {
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 0;
    background: transparent;
    overflow: hidden;
    width: 74px;
    height: 74px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

    .details-thumb-btn.active {
        border-color: #111827;
    }

.details-thumb-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #fff;
}

.details-no-photo {
    padding: 18px;
    border-radius: 16px;
    background: #f9fafb;
    color: #6b7280;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.edit-key-form .form-control,
.edit-key-form .form-select,
.edit-key-form textarea {
    border-radius: 12px;
    min-height: 44px;
}

.edit-key-form textarea {
    min-height: 120px;
    resize: vertical;
}

.workers-page {
    display: grid;
    gap: 1rem;
    max-width: 1780px;
    margin: 0 auto;
    width: 100%;
}

.workers-layout {
    display: grid;
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
    gap: 1rem;
}

.workers-list-card,
.workers-main-card {
    background: #fff;
    border: 1px solid #e7ebf2;
    border-radius: 14px;
    padding: 1rem;
}

.workers-card-title {
    font-weight: 700;
    margin-bottom: .75rem;
}

.workers-main-card {
    max-width: 1180px;
}

.workers-subcard {
    border: 1px solid #e7ebf2;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.user-list {
    display: grid;
    gap: .5rem;
    max-height: 70vh;
    overflow: auto;
}

.user-item {
    width: 100%;
    border: 1px solid #dfe5ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: .65rem .75rem;
    text-align: left;
    display: grid;
    gap: .1rem;
}

.user-item:hover {
    border-color: #bcc8da;
    background: #f1f5fb;
}

.user-item.selected {
    border-color: #1f2937;
    background: #e7eef8;
}

.user-item-name {
    font-weight: 700;
}

.user-item-sub {
    color: #5f6a7a;
    font-size: .85rem;
}

.perm-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .6rem;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #f9fbff;
    margin-bottom: .4rem;
}

.perm-line label {
    margin: 0;
    font-weight: 600;
}

.perm-line input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    .workers-layout {
        grid-template-columns: 1fr;
    }
}
.admin-swal-popup {
  border-radius: 14px;
  border: 1px solid #dbe2ea;
  box-shadow: 0 18px 48px rgba(9, 30, 66, 0.18);
}

.admin-swal-confirm,
.admin-swal-cancel {
  min-width: 110px;
  border-radius: 10px;
  border: 0;
  padding: 0.5rem 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.admin-swal-confirm {
  background: #1f6feb;
  color: #fff;
}

.admin-swal-confirm:hover {
  background: #1a5fd0;
}

.admin-swal-cancel {
  background: #eef2f6;
  color: #243447;
}

.admin-swal-cancel:hover {
  background: #e1e8f0;
}

.dashboard-page {
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 1rem;
}

.dashboard-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.dashboard-subtitle {
  color: #637387;
}

.dashboard-filters-card,
.dashboard-card {
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 22px rgba(9, 30, 66, 0.06);
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.dashboard-charts {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.1fr 1fr;
}

.dashboard-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.dashboard-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-item {
  background: #f7f9fc;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}

.metric-label {
  color: #6b7d90;
  font-size: 0.84rem;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f2d3d;
  line-height: 1.1;
}

.dashboard-chart-box {
  position: relative;
  height: 320px;
}

.dashboard-chart-box-sm {
  height: 260px;
}

.dashboard-chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.dashboard-chart-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7d90;
  background: #f8fafc;
  border: 1px dashed #d6e0ea;
  border-radius: 12px;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-box {
    height: 260px;
  }
}

.statistics-page {
    max-width: 1600px;
    margin: 0 auto;
}

.statistics-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.statistics-users {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.statistics-tree {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    max-height: 420px;
    overflow: auto;
}

.statistics-worker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "role role role"
        "check name count";
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 0.55rem;
}

.statistics-worker-bus {
    background: #f8fafc;
    font-weight: 700;
}

.statistics-worker-promoter {
    margin-left: 1.6rem;
    background: #fbfcfe;
}

.statistics-worker-unlinked {
    background: #fffdf8;
}

.statistics-worker-name {
    grid-area: name;
    color: #111827;
    min-width: 0;
    overflow-wrap: anywhere;
}

.statistics-worker-role {
    grid-area: role;
    color: #4b5563;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    margin-bottom: 0.1rem;
}

.statistics-worker .form-check-input {
    grid-area: check;
    margin-top: 0;
}

.statistics-worker-count {
    grid-area: count;
    color: #6b7280;
    font-size: 0.84rem;
    white-space: nowrap;
}

.statistics-separator {
    margin: 0.9rem 0 0.7rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #d1d5db;
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.statistics-days {
    display: grid;
    gap: 1rem;
    padding-top: 1rem;
}

.statistics-chart-card {
    padding-top: 1rem;
}

.statistics-day-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.statistics-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    background: #f9fbfd;
}

.statistics-day-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.statistics-day-subtitle {
    color: #6b7280;
    font-size: 0.92rem;
}

.statistics-day-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.statistics-badge-ordered {
    background: #f8efc9;
    color: #7a5a00;
}

.statistics-badge-completed {
    background: #dcefdc;
    color: #1f5d2f;
}

.statistics-row-viewed > td {
    background: #ffffff;
}

.statistics-row-ordered > td {
    background: #fffbe6;
}

.statistics-row-completed > td {
    background: #edf8ef;
}

@media (max-width: 991.98px) {
    .statistics-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statistics-worker {
        grid-template-columns: auto minmax(0, 1fr);
        }

    .statistics-day-header {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .statistics-summary {
        grid-template-columns: 1fr;
    }
}
