/**
 * Kamaran Truck Parts - Advanced Admin Panel Styles
 * Card-based layout, advanced filters, fully responsive (mobile-first friendly)
 */

:root {
    --adm-radius: 16px;
    --adm-radius-sm: 10px;
    --adm-panel: rgba(255, 255, 255, 0.045);
    --adm-border: rgba(255, 255, 255, 0.09);
    --adm-muted: rgba(255, 255, 255, 0.62);
    --adm-accent: #f39c12;
    --adm-accent-2: #e67e22;
    --adm-success: #2ecc71;
    --adm-danger: #e74c3c;
    --adm-info: #4aa3ff;
    --adm-sidebar-w: 255px;
}

body.admin-body {
    background:
        radial-gradient(1100px 520px at 88% -10%, rgba(243, 156, 18, 0.09), transparent 60%),
        radial-gradient(900px 420px at -10% 110%, rgba(74, 163, 255, 0.06), transparent 60%),
        var(--primary-dark);
}

/* ==================== Login ==================== */
.adm-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.adm-login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--adm-border);
    border-radius: 22px;
    padding: 38px 32px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    animation: admPop 0.5s ease-out;
}

.adm-login-logo {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2));
    color: #1a1a2e;
    box-shadow: 0 12px 32px rgba(243, 156, 18, 0.35);
}

.adm-login-card h1 {
    text-align: center;
    font-size: 1.45rem;
    margin-bottom: 6px;
}

.adm-login-sub {
    text-align: center;
    color: var(--adm-muted);
    margin-bottom: 26px;
    font-size: 0.95rem;
}

.adm-login-error {
    background: rgba(231, 76, 60, 0.16);
    border: 1px solid rgba(231, 76, 60, 0.55);
    color: #ff8b7e;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    text-align: center;
    font-size: 0.92rem;
}

.adm-login-back {
    display: block;
    text-align: center;
    margin-top: 22px;
    color: var(--adm-muted);
    font-size: 0.9rem;
}

.adm-login-back:hover {
    color: var(--adm-accent);
}

/* ==================== App Layout ==================== */
.admin-app {
    display: flex;
    min-height: 100vh;
}

.adm-sidebar {
    width: var(--adm-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #16213e;
    border-inline-end: 1px solid var(--adm-border);
    padding: 18px 13px;
    z-index: 1100;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--adm-border);
    margin-bottom: 12px;
}

.adm-brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2));
    flex-shrink: 0;
}

.adm-brand b {
    display: block;
    font-size: 0.94rem;
    line-height: 1.3;
}

.adm-brand span {
    font-size: 0.76rem;
    color: var(--adm-muted);
}

/* Close button inside the brand row (visible on mobile dropdown menu only) */
.adm-side-close {
    display: none;
    width: 40px;
    height: 40px;
    margin-inline-start: auto;
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    font-size: 1.05rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    place-items: center;
}

.adm-side-close:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.6);
}

.adm-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.adm-navlink {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: start;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.adm-navlink:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.adm-navlink.active {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.22), rgba(230, 126, 34, 0.1));
    color: var(--adm-accent);
    box-shadow: inset 3px 0 0 var(--adm-accent);
}

[dir="ltr"] .adm-navlink.active {
    box-shadow: inset -3px 0 0 var(--adm-accent);
}

.adm-navlink .ico {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.adm-navcount {
    margin-inline-start: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.74rem;
    font-weight: 700;
}

.adm-sidefoot {
    border-top: 1px solid var(--adm-border);
    padding-top: 12px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.adm-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px 12px;
}

.adm-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #1a1a2e;
    background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2));
    flex-shrink: 0;
}

.adm-user b {
    display: block;
    font-size: 0.88rem;
    line-height: 1.25;
}

.adm-user span {
    font-size: 0.74rem;
    color: var(--adm-muted);
}

.adm-navlink.danger:hover {
    background: rgba(231, 76, 60, 0.14);
    color: #ff9d92;
}

.adm-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.adm-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px clamp(14px, 2.6vw, 32px);
    background: rgba(26, 26, 46, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--adm-border);
}

.adm-topbar h2 {
    font-size: 1.12rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-spacer {
    flex: 1;
}

.adm-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    font-size: 1.15rem;
    cursor: pointer;
    flex-shrink: 0;
}

.adm-menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.adm-content {
    padding: 22px clamp(13px, 2.6vw, 32px) 80px;
}

.adm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    display: none;
}

.admin-app.nav-open .adm-overlay {
    display: block;
}

/* ==================== Tabs ==================== */
.adm-tab {
    display: none;
}

.adm-tab.active {
    display: block;
    animation: admFade 0.3s ease-out;
}

@keyframes admFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ==================== Buttons & Inputs ==================== */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--adm-radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.adm-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.adm-btn-primary {
    background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2));
    color: #1a1a2e;
}

.adm-btn-primary:hover {
    background: linear-gradient(135deg, var(--adm-accent-2), var(--adm-accent));
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(243, 156, 18, 0.3);
}

.adm-btn-ghost {
    background: transparent;
    border-color: var(--adm-border);
}

.adm-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.adm-btn-danger {
    background: rgba(231, 76, 60, 0.18);
    border-color: rgba(231, 76, 60, 0.5);
    color: #ff8b7e;
}

.adm-btn-danger:hover {
    background: rgba(231, 76, 60, 0.3);
}

.adm-btn-sm {
    padding: 7px 13px;
    font-size: 0.87rem;
}

.adm-btn-block {
    width: 100%;
}

.adm-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.adm-field {
    margin-bottom: 14px;
    min-width: 0;
}

.adm-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.85);
}

.adm-input,
.adm-select,
.adm-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--adm-border);
    color: var(--text-light);
    padding: 11px 13px;
    border-radius: var(--adm-radius-sm);
    font: inherit;
    font-size: 0.94rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
    border-color: var(--adm-accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.16);
}

.adm-input::placeholder,
.adm-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.adm-select option {
    background: #16213e;
    color: #ecf0f1;
}

.adm-textarea {
    resize: vertical;
    min-height: 84px;
}

input[type="search"].adm-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* ==================== Dashboard ==================== */
.adm-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.14), rgba(74, 163, 255, 0.08));
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}

.adm-hero h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
}

.adm-hero p {
    margin: 0;
    color: var(--adm-muted);
    font-size: 0.92rem;
}

.adm-hero .date-chip {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--adm-border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
}

.adm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.adm-stat {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 16px 18px;
    cursor: pointer;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.adm-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(243, 156, 18, 0.5);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.adm-stat-ico {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: rgba(243, 156, 18, 0.13);
    flex-shrink: 0;
}

.adm-stat-val {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.15;
}

.adm-stat-lbl {
    color: var(--adm-muted);
    font-size: 0.85rem;
}

.adm-stat-sub {
    font-size: 0.75rem;
    color: var(--adm-muted);
    opacity: 0.9;
}

.adm-panel {
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 18px;
}

.adm-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.adm-panel-head h3 {
    font-size: 1.02rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-cols {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
}

.adm-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.adm-quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 12px;
    border-radius: 12px;
    border: 1px dashed var(--adm-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-light);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adm-quick-btn:hover {
    background: rgba(243, 156, 18, 0.12);
    border-color: rgba(243, 156, 18, 0.5);
    color: var(--adm-accent);
    transform: translateY(-2px);
}

.adm-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.adm-mini:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--adm-border);
}

.adm-mini-thumb {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    overflow: hidden;
    position: relative;
}

.adm-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.adm-mini-thumb.no-img::after {
    content: '🚛';
}

.adm-mini-info {
    flex: 1;
    min-width: 0;
}

.adm-mini-info b {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-mini-info span {
    font-size: 0.78rem;
    color: var(--adm-muted);
}

.adm-mini-views {
    font-weight: 800;
    color: var(--adm-accent);
    font-size: 0.88rem;
    white-space: nowrap;
}

.adm-act {
    display: flex;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
}

.adm-act:hover {
    background: rgba(255, 255, 255, 0.05);
}

.adm-act-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.adm-act-body {
    flex: 1;
    min-width: 0;
}

.adm-act-body b {
    font-size: 0.86rem;
    display: block;
}

.adm-act-body span {
    font-size: 0.78rem;
    color: var(--adm-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-act-time {
    font-size: 0.74rem !important;
    opacity: 0.85;
}

.adm-no-activity {
    text-align: center;
    color: var(--adm-muted);
    padding: 26px 10px;
    font-size: 0.9rem;
    margin: 0;
}

/* ==================== Toolbar & Filters ==================== */
.adm-toolbar {
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adm-toolrow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.adm-search {
    position: relative;
    flex: 1 1 250px;
    min-width: 190px;
}

.adm-search .adm-input {
    padding-inline-start: 40px;
    padding-inline-end: 38px;
}

.adm-search-ico {
    position: absolute;
    inset-inline-start: 13px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    font-size: 0.95rem;
    pointer-events: none;
}

.adm-search-clear {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--adm-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    display: none;
    line-height: 1;
}

.adm-search-clear:hover {
    color: #fff;
}

.adm-search.has-value .adm-search-clear {
    display: block;
}

.adm-select-sm {
    flex: 0 1 170px;
    min-width: 135px;
}

.adm-adv {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--adm-border);
}

.adm-adv.show {
    display: flex;
}

.adm-fprice {
    display: flex;
    align-items: center;
    gap: 7px;
}

.adm-fprice .adm-input {
    width: 112px;
}

.adm-fprice .sep {
    color: var(--adm-muted);
    font-size: 0.85rem;
}

.adm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.adm-chips:empty {
    display: none;
}

.adm-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(243, 156, 18, 0.14);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #ffd08a;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.79rem;
    max-width: 100%;
}

.adm-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0 0 2px;
}

.adm-chip button:hover {
    color: #fff;
}

.adm-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 2px 2px 14px;
    color: var(--adm-muted);
    font-size: 0.88rem;
}

/* ==================== Cards Grid ==================== */
.adm-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.adm-card {
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}

.adm-card:hover {
    transform: translateY(-4px);
    border-color: rgba(243, 156, 18, 0.45);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.adm-card-media {
    position: relative;
    height: 168px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}

.adm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.adm-card:hover .adm-card-media img {
    transform: scale(1.06);
}

.adm-card-media.no-img::after {
    content: '🚛';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    opacity: 0.3;
}

.adm-badge {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}

.adm-badge-status {
    inset-inline-start: 10px;
}

.adm-badge-status.on {
    color: #7dffb0;
    border: 1px solid rgba(46, 204, 113, 0.55);
    background: rgba(16, 60, 35, 0.6);
}

.adm-badge-status.off {
    color: #ff9d92;
    border: 1px solid rgba(231, 76, 60, 0.55);
    background: rgba(70, 20, 16, 0.6);
}

.adm-badge-views {
    inset-inline-end: 10px;
    background: rgba(0, 0, 0, 0.52);
    color: #ffd08a;
}

.adm-card-body {
    padding: 13px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.adm-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.adm-sub {
    font-size: 0.83rem;
    color: var(--adm-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-desc {
    font-size: 0.81rem;
    color: var(--adm-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}

.adm-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.adm-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(74, 163, 255, 0.13);
    border: 1px solid rgba(74, 163, 255, 0.35);
    color: #9fd0ff;
    font-size: 0.75rem;
    padding: 3px 9px;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-price {
    font-weight: 800;
    color: var(--adm-accent);
    font-size: 1.04rem;
    white-space: nowrap;
}

.adm-foot {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--adm-border);
}

.adm-icon-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    border-radius: 10px;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.adm-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.adm-icon-btn.view:hover {
    border-color: rgba(243, 156, 18, 0.65);
    color: #ffd08a;
}

.adm-icon-btn.edit:hover {
    border-color: rgba(74, 163, 255, 0.65);
    color: #9fd0ff;
}

.adm-icon-btn.del:hover {
    border-color: rgba(231, 76, 60, 0.65);
    color: #ff9d92;
}

/* ==================== Pager & Empty ==================== */
.adm-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.adm-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adm-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.adm-page-btn.active {
    background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-2));
    color: #1a1a2e;
    border-color: transparent;
}

.adm-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.adm-page-info {
    color: var(--adm-muted);
    font-size: 0.86rem;
    padding: 0 6px;
}

.adm-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--adm-muted);
    border: 1px dashed var(--adm-border);
    border-radius: var(--adm-radius);
    background: var(--adm-panel);
}

.adm-empty .big {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.55;
}

.adm-empty h3 {
    margin-bottom: 6px;
}

.adm-empty p {
    margin-bottom: 18px;
    font-size: 0.92rem;
}

/* ==================== Modals ==================== */
.adm-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, 0.74);
    backdrop-filter: blur(4px);
    z-index: 2200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.adm-modal.show {
    display: flex;
}

.adm-modal-card {
    background: var(--secondary-dark);
    border: 1px solid var(--adm-border);
    border-radius: 20px;
    width: 100%;
    max-width: 620px;
    padding: 22px;
    margin: auto;
    animation: admPop 0.28s ease-out;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

@keyframes admPop {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.adm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.adm-modal-head h3 {
    margin: 0;
    font-size: 1.12rem;
}

.adm-x {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.adm-x:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.6);
}

.adm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.adm-form-grid .full {
    grid-column: 1 / -1;
}

.adm-img-preview {
    display: none;
}

.adm-img-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    margin-top: 4px;
}

.adm-hint {
    font-size: 0.78rem;
    color: var(--adm-muted);
    margin-top: 6px;
}

/* Confirm dialog */
.adm-confirm-card {
    max-width: 440px;
    text-align: center;
    padding: 30px 24px;
}

.adm-confirm-ico {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.adm-confirm-card h3 {
    margin-bottom: 8px;
    font-size: 1.08rem;
}

.adm-confirm-card p {
    color: var(--adm-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
    word-break: break-word;
}

.adm-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.adm-confirm-actions .adm-btn {
    flex: 1;
}

/* Quick view */
.qv-media-wrap {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--adm-border);
    background: rgba(255, 255, 255, 0.04);
    min-height: 60px;
}

.qv-media-wrap.no-img {
    min-height: 180px;
}

.qv-media-wrap.no-img::after {
    content: '🚛';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 3.2rem;
    opacity: 0.3;
}

.qv-media {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.qv-title {
    margin: 16px 0 4px;
    font-size: 1.25rem;
}

.qv-sub {
    color: var(--adm-muted);
    margin: 0 0 12px;
    font-size: 0.92rem;
}

.qv-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.qv-meta .adm-badge-status {
    position: static;
}

.qv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.qv-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 10px 12px;
}

.qv-item span {
    display: block;
    font-size: 0.74rem;
    color: var(--adm-muted);
    margin-bottom: 2px;
}

.qv-item b {
    font-size: 0.9rem;
}

.qv-desc-wrap {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.qv-lbl {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--adm-accent);
    margin-bottom: 4px;
}

.qv-desc {
    color: var(--adm-muted);
    font-size: 0.9rem;
    white-space: pre-line;
    margin: 0 0 10px;
}

.qv-desc:last-child {
    margin-bottom: 0;
}

/* ==================== Toasts ==================== */
.adm-toasts {
    position: fixed;
    bottom: 22px;
    inset-inline-start: 22px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, 90vw);
}

.adm-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(22, 33, 62, 0.97);
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    animation: admToastIn 0.3s ease-out;
    font-size: 0.9rem;
}

.adm-toast.success {
    border-color: rgba(46, 204, 113, 0.55);
}

.adm-toast.error {
    border-color: rgba(231, 76, 60, 0.55);
}

.adm-toast.out {
    animation: admToastOut 0.3s ease-in forwards;
}

@keyframes admToastIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes admToastOut {
    to { opacity: 0; transform: translateY(14px); }
}

/* ==================== Danger zone (data reset) ==================== */
.adm-danger {
    background: rgba(231, 76, 60, 0.06);
    border: 1px solid rgba(231, 76, 60, 0.35);
    border-radius: var(--adm-radius);
    padding: 18px;
    max-width: 780px;
}

.adm-danger-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ff8b7e;
    margin-bottom: 8px;
    font-size: 1.02rem;
}

.adm-danger-note {
    color: var(--adm-muted);
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.adm-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--adm-border);
    border-radius: 14px;
    padding: 14px 16px;
}

.adm-danger-row + .adm-danger-row {
    margin-top: 10px;
}

.adm-danger-row b {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.adm-danger-row span {
    display: block;
    color: var(--adm-muted);
    font-size: 0.82rem;
    max-width: 460px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1080px) {
    .adm-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    /* Sidebar becomes a slide-down dropdown menu (full width, below the top bar) */
    .adm-sidebar {
        position: fixed;
        top: 0;
        inset-inline: 0;
        bottom: auto;
        width: auto;
        height: auto;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 0 14px 16px;
        border-inline-end: none;
        border-bottom: 1px solid var(--adm-border);
        border-radius: 0 0 24px 24px;
        box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.85);
        transform: translateY(-108%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.24s ease, visibility 0.32s;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1200;
    }

    .admin-app.nav-open .adm-sidebar {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .adm-side-close {
        display: grid;
    }

    .adm-brand {
        padding: 14px 6px 14px;
        margin-bottom: 8px;
    }

    /* Bigger touch targets for the mobile menu */
    .adm-navlink {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 14px;
    }

    .adm-nav {
        overflow: visible;
        flex: none;
    }

    .adm-sidefoot {
        margin-top: 10px;
    }

    .adm-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .adm-grid {
        grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
        gap: 11px;
    }

    .adm-danger-row .adm-btn {
        width: 100%;
    }

    .adm-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 11px;
    }

    .adm-stat {
        padding: 13px 14px;
        gap: 11px;
    }

    .adm-stat-ico {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border-radius: 12px;
    }

    .adm-stat-val {
        font-size: 1.38rem;
    }

    .adm-card-media {
        height: 132px;
    }

    .adm-card-body {
        padding: 11px 11px 12px;
        gap: 7px;
    }

    .adm-title {
        font-size: 0.92rem;
    }

    .adm-desc {
        display: none;
    }

    .adm-icon-btn .lbl {
        display: none;
    }

    .adm-icon-btn {
        min-height: 42px;
        font-size: 1rem;
    }

    .adm-topbar {
        padding: 11px 13px;
    }

    .adm-content {
        padding: 16px 12px 90px;
    }

    .adm-hero {
        padding: 16px;
    }

    .adm-hero h2 {
        font-size: 1.08rem;
    }

    .adm-toolbar {
        padding: 11px;
    }

    .adm-search {
        flex: 1 1 100%;
    }

    .adm-select-sm {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }

    .adm-pager .adm-page-btn[data-page] {
        display: none;
    }

    .adm-pager .adm-page-btn[data-page].active {
        display: inline-block;
    }

    .adm-fprice .adm-input {
        width: 96px;
    }

    .qv-grid {
        grid-template-columns: 1fr 1fr;
    }

    .adm-toasts {
        inset-inline-start: 12px;
        inset-inline-end: 12px;
        max-width: none;
    }

    .adm-modal {
        padding: 12px;
    }

    .adm-modal-card {
        padding: 18px 15px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .adm-form-grid {
        grid-template-columns: 1fr;
    }

    .adm-confirm-actions {
        flex-direction: column;
    }
}
