/* Admin panel layout */
/* ============================================================
   DESIGN TOKENS — Shipping Manifest Admin Sidebar
   ============================================================ */
:root {
    /* Surfaces */
    --sb-bg:              #12151C;
    --sb-surface-hover:   rgba(255,255,255,0.04);
    --sb-border:          rgba(255,255,255,0.08);

    /* Accent — teal */
    --sb-teal:            #1D9E75;
    --sb-teal-light:      #5DCAA5;
    --sb-teal-dark:       #04342C;
    --sb-teal-bg:         rgba(29,158,117,0.12);
    --sb-teal-border:     #1D9E75;

    /* Warning — amber */
    --sb-amber:           #EF9F27;
    --sb-amber-bg:        rgba(239,159,39,0.14);

    /* Text */
    --sb-text-primary:    #F2F3F5;
    --sb-text-secondary:  #B7BCC6;
    --sb-text-muted:      #6B7280;
    --sb-text-label:      #454B57;

    /* Icons */
    --sb-icon-default:    #7B8290;

    /* Layout */
    --sb-width:           260px;
    --sb-width-collapsed: 60px;
    --sb-collapse-bp:     900px;

    /* Type */
    --sb-font-mono: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

.admin-layout-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #fff;
}

/* ============================================================
   SIDEBAR — BASE
   ============================================================ */
.admin-sidebar {
    width: var(--sb-width);
    min-height: 100vh;
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--sb-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    transition: width 0.2s ease;
    z-index: 100;
}

/* ?? Header ?? */
.admin-sidebar__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 1rem 1.1rem;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}

.admin-sidebar__logo {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--sb-teal);
    color: var(--sb-teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.admin-sidebar__wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    overflow: hidden;
}

.admin-sidebar__wordmark-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--sb-text-primary);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.admin-sidebar__wordmark-sub {
    font-family: var(--sb-font-mono);
    font-size: 0.65rem;
    color: var(--sb-text-muted);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ?? Search ?? */
.admin-sidebar__search-wrap {
    padding: 0.75rem 0.75rem 0.5rem;
    flex-shrink: 0;
}

.admin-sidebar__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    cursor: text;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-sidebar__search:focus-within {
    border-color: var(--sb-teal);
    background: rgba(29,158,117,0.06);
}

.admin-sidebar__search-icon {
    font-size: 12px;
    color: var(--sb-icon-default);
    flex-shrink: 0;
}

.admin-sidebar__search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--sb-text-primary);
    font-size: 0.78rem;
    min-width: 0;
}

.admin-sidebar__search-input::placeholder {
    color: var(--sb-text-muted);
}

.admin-sidebar__search-kbd {
    font-family: var(--sb-font-mono);
    font-size: 0.6rem;
    color: var(--sb-text-muted);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--sb-border);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

/* ?? Scrollable nav ?? */
.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.6rem 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.admin-sidebar__nav::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Section eyebrows */
.admin-sidebar__eyebrow {
    font-family: var(--sb-font-mono);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sb-text-label);
    padding: 0.9rem 0.4rem 0.3rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
}

/* Nav list */
.admin-sidebar__list {
    list-style: none;
    margin: 0 0 0.15rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Nav links */
.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 2px solid transparent;
    color: var(--sb-text-secondary);
    text-decoration: none;
    font-size: 0.8375rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    position: relative;
}

.admin-sidebar__link:hover {
    background: var(--sb-surface-hover);
    color: var(--sb-text-primary);
    text-decoration: none;
    border-left-color: rgba(29,158,117,0.35);
}

.admin-sidebar__link.is-active {
    background: var(--sb-teal-bg);
    color: var(--sb-teal-light);
    border-left-color: var(--sb-teal-border);
    font-weight: 600;
}

.admin-sidebar__link[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
}

/* Icons */
.admin-sidebar__icon {
    font-size: 15px;
    color: var(--sb-icon-default);
    flex-shrink: 0;
    transition: color 0.12s ease;
    width: 16px;
    text-align: center;
}

.admin-sidebar__link:hover .admin-sidebar__icon {
    color: var(--sb-text-secondary);
}

.admin-sidebar__link.is-active .admin-sidebar__icon {
    color: var(--sb-teal-light);
}

/* Labels */
.admin-sidebar__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.admin-sidebar__badge {
    font-family: var(--sb-font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 10px;
    padding: 2px 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.admin-sidebar__badge--teal {
    background: var(--sb-teal);
    color: var(--sb-teal-dark);
}

.admin-sidebar__badge--warning {
    background: var(--sb-amber-bg);
    color: var(--sb-amber);
}

.admin-sidebar__badge--muted {
    background: rgba(255,255,255,0.06);
    color: var(--sb-text-muted);
}

/* ?? Footer / user row ?? */
.admin-sidebar__footer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.85rem;
    border-top: 1px solid var(--sb-border);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.12s ease;
}

.admin-sidebar__footer:hover {
    background: var(--sb-surface-hover);
}

.admin-sidebar__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #5B4FCA;
    color: #fff;
    font-family: var(--sb-font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.admin-sidebar__user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
    flex: 1;
}

.admin-sidebar__user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sb-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-sidebar__user-role {
    font-family: var(--sb-font-mono);
    font-size: 0.6rem;
    color: var(--sb-text-muted);
    white-space: nowrap;
}

.admin-sidebar__chevron {
    font-size: 12px;
    color: var(--sb-icon-default);
    flex-shrink: 0;
}

/* ?? Tooltip (collapsed state) ?? */
.admin-sidebar__link[data-tooltip] {
    position: relative;
}

.admin-sidebar__link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1E2330;
    color: var(--sb-text-primary);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: 5px;
    white-space: nowrap;
    border: 1px solid var(--sb-border);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 200;
}

/* ============================================================
   COLLAPSED STATE  (<= 900px)
   ============================================================ */
@media (max-width: 900px) {
    .admin-sidebar {
        width: var(--sb-width-collapsed);
    }

    .admin-sidebar__wordmark,
    .admin-sidebar__search-input,
    .admin-sidebar__search-kbd,
    .admin-sidebar__eyebrow,
    .admin-sidebar__label,
    .admin-sidebar__badge,
    .admin-sidebar__user-info,
    .admin-sidebar__chevron {
        display: none;
    }

    .admin-sidebar__header {
        justify-content: center;
        padding: 1rem 0;
    }

    .admin-sidebar__search {
        justify-content: center;
        padding: 0.45rem;
    }

    .admin-sidebar__search-icon {
        font-size: 14px;
    }

    .admin-sidebar__nav {
        padding: 0.5rem 0.4rem;
    }

    .admin-sidebar__link {
        justify-content: center;
        padding: 9px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 6px;
        gap: 0;
    }

    .admin-sidebar__link:hover {
        border-left-color: transparent;
        border-bottom-color: rgba(29,158,117,0.35);
    }

    .admin-sidebar__link.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--sb-teal-border);
    }

    .admin-sidebar__icon {
        width: auto;
        font-size: 16px;
    }

    .admin-sidebar__footer {
        justify-content: center;
        padding: 0.75rem 0;
    }

    /* Show tooltips on collapsed hover */
    .admin-sidebar__link[data-tooltip]:hover::after {
        opacity: 1;
    }
}

.admin-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-panel .form-control,
.admin-panel .form-select,
.admin-panel textarea,
.admin-panel input[type="text"],
.admin-panel input[type="email"],
.admin-panel input[type="number"],
.admin-panel input[type="password"],
.admin-panel input[type="tel"] {
    border: 1px solid #cfd9e4;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: inset 0 1px 4px rgba(132, 139, 200, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-panel .form-control:focus,
.admin-panel .form-select:focus,
.admin-panel textarea:focus,
.admin-panel input[type="text"]:focus,
.admin-panel input[type="email"]:focus,
.admin-panel input[type="number"]:focus,
.admin-panel input[type="password"]:focus,
.admin-panel input[type="tel"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.3);
    outline: none;
}

.admin-panel .card {
    border-radius: 1rem;
}

@media (max-width: 1024px) {
    .admin-dashboard {
        flex-direction: column;
        padding: 1rem;
    }

    .admin-sidebar {
        width: 100%;
        position: relative;
        top: auto;
        min-height: auto;
    }
}
.admin-layout-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem;
    text-align: center;
    background: #f8f9fa;
}
