.admin {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

/* SIDEBAR */
.admin-sidebar {
    width: 240px;
    background: #1f2937;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.admin-sidebar__logo {
    padding: 20px;
    font-size: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-menu {
    display: flex;
    flex-direction: column;
}

.admin-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 12px;
    margin: 4px 10px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.admin-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
    text-decoration: none;
}

.admin-menu a.is-active {
    background: #2d3b52;
    color: #fff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #84cc16;
}

/* MAIN */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.admin-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* CONTENT */
.admin-content {
    padding: 20px;
}

body {
    background: #f3f5f9;
}

/* page */
.admin-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-page__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-page__eyebrow {
    font-size: 13px;
    color: #7b8794;
    margin-bottom: 6px;
}

.admin-page__title {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
    color: #17212b;
}

.admin-page__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* cards */
.admin-card {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

/* alerts */
.admin-alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.admin-alert--success {
    background: #eaf8ef;
    color: #166534;
    border: 1px solid #ccefd7;
}

.admin-alert--danger {
    background: #fef0f0;
    color: #b42318;
    border: 1px solid #f6d3d1;
}

/* buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.18s ease;
}

.admin-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.admin-btn--primary {
    background: #74b816;
    color: #fff;
    border-color: #74b816;
}

.admin-btn--primary:hover {
    background: #679f14;
    border-color: #679f14;
    color: #fff;
}

.admin-btn--ghost {
    background: #fff;
    color: #253041;
    border-color: #d8dee8;
}

.admin-btn--ghost:hover {
    background: #f8fafc;
    color: #111827;
}

.admin-btn--sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 10px;
}

/* filters */
.admin-filters {
    padding: 20px;
}

.admin-filters__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}

.admin-filters__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-field label {
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.admin-field input,
.admin-field select,
.admin-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d6dde8;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    outline: none;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-select:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.admin-select--sm {
    width: auto;
    min-width: 170px;
    height: 40px;
}

/* section title */
.admin-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    margin-top: 8px;
}

.admin-section-title__dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 3px #fff;
    border: 1px solid #b6c2d2;
}

/* table */
.admin-table-card {
    overflow: hidden;
}

.admin-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f6;
    background: #fff;
    flex-wrap: wrap;
}

.admin-table-toolbar__meta {
    font-size: 14px;
    color: #667085;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table thead th {
    background: #f8fafc;
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    padding: 14px 14px;
    border-bottom: 1px solid #e9eef5;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
    background: #fff;
}

.admin-table tbody tr:hover td {
    background: #fbfcfe;
}

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

.admin-table .cell-checkbox {
    width: 44px;
    text-align: center;
}

.text-right {
    text-align: right;
}

.admin-link-strong {
    font-weight: 800;
    color: #c81e1e;
    text-decoration: none;
}

.admin-link-strong:hover {
    text-decoration: underline;
}

.admin-link-muted {
    color: #475467;
    text-decoration: none;
}

.admin-link-muted:hover {
    text-decoration: underline;
}

.admin-date {
    line-height: 1.25;
    color: #1f2937;
    font-size: 14px;
}

.admin-date__time {
    color: #6b7280;
    font-size: 13px;
    margin-top: 3px;
}

.admin-customer__name {
    font-weight: 700;
    color: #b91c1c;
}

.admin-price {
    font-weight: 800;
    color: #1f2937;
    white-space: nowrap;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* badges */
.admin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}

.admin-badge.is-new {
    background: #e8f1ff;
    color: #1d4ed8;
    border-color: #cfe0ff;
}

.admin-badge.is-paid {
    background: #e9f9ee;
    color: #15803d;
    border-color: #cdeed7;
}

.admin-badge.is-processing {
    background: #fff6dd;
    color: #a16207;
    border-color: #f3e1a8;
}

.admin-badge.is-ready,
.admin-status-select--is-ready {
    background: #fff7e6;
    color: #b26b00;
    border-color: #f2d39b;
}

.admin-badge.is-shipped {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #ddd1fe;
}

.admin-badge.is-cancelled {
    background: #fdecec;
    color: #b42318;
    border-color: #f6d1cf;
}

.admin-badge.is-default {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

/* empty */
.admin-empty {
    padding: 34px 20px;
    text-align: center;
    color: #667085;
}

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f9;
}

.admin-login__box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.admin-method {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-method__icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 24px;
    background: #fff;
    border-radius: 6px;
}

.admin-method__name {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.25;
}

.admin-inline-status-form {
    margin: 0;
}

.admin-status-select {
    min-width: 160px;
    height: 38px;
    padding: 0 36px 0 12px;
    border-radius: 999px;
    border: 1px solid #d6dde8;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.admin-status-select--is-new {
    background: #e8f1ff;
    color: #1d4ed8;
    border-color: #cfe0ff;
}

.admin-status-select--is-paid {
    background: #e9f9ee;
    color: #15803d;
    border-color: #cdeed7;
}

.admin-status-select--is-processing {
    background: #fff6dd;
    color: #a16207;
    border-color: #f3e1a8;
}

.admin-status-select--is-shipped {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #ddd1fe;
}

.admin-status-select--is-cancelled {
    background: #fdecec;
    color: #b42318;
    border-color: #f6d1cf;
}

.admin-status-select--is-default {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.admin-actions-dropdown {
    position: relative;
    display: inline-block;
}

.admin-actions-dropdown__toggle {
    width: 38px;
    height: 38px;
    border: 1px solid #d8dee8;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #344054;
}

.admin-actions-dropdown__toggle:hover {
    background: #f8fafc;
}

.admin-actions-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    padding: 8px;
    z-index: 50;
}

.admin-actions-dropdown__menu a,
.admin-actions-dropdown__menu button {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    text-align: left;
    text-decoration: none;
    color: #1f2937;
    font-size: 14px;
    cursor: pointer;
}

.admin-actions-dropdown__menu a:hover,
.admin-actions-dropdown__menu button:hover {
    background: #f8fafc;
    text-decoration: none;
}

.admin-actions-dropdown__menu button.is-danger {
    color: #b42318;
}

.admin-card__head {
    padding: 18px 20px 0;
}

.admin-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #17212b;
}

.admin-order-detail__head-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: #667085;
    font-size: 14px;
}

.admin-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.admin-order-main,
.admin-order-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-order-side {
    position: sticky;
    top: 20px;
}

.admin-order-timeline-card {
    padding: 20px;
}

.admin-order-timeline__title {
    font-size: 18px;
    font-weight: 800;
    color: #17212b;
    margin-bottom: 18px;
}

.admin-order-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.admin-order-timeline--cancelled {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-order-timeline__item {
    position: relative;
    text-align: center;
    padding-top: 4px;
}

.admin-order-timeline__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 17px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: #d9e1ec;
    z-index: 0;
}

.admin-order-timeline__item.is-done:not(:last-child)::after,
.admin-order-timeline__item.is-current:not(:last-child)::after {
    background: #84cc16;
}

.admin-order-timeline__dot {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    background: #eef2f7;
    color: #6b7280;
    border: 2px solid #d9e1ec;
}

.admin-order-timeline__item.is-done .admin-order-timeline__dot {
    background: #84cc16;
    border-color: #84cc16;
    color: #fff;
}

.admin-order-timeline__item.is-current .admin-order-timeline__dot {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.admin-order-timeline__item.is-cancelled .admin-order-timeline__dot {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.admin-order-timeline__label {
    font-size: 13px;
    font-weight: 700;
    color: #344054;
    line-height: 1.35;
}

.admin-order-items-card .admin-table tfoot td {
    background: #f8fafc;
    border-top: 1px solid #e9eef5;
    font-size: 14px;
}

.admin-order-item__name {
    font-weight: 700;
    color: #17212b;
}

.admin-order-item__code {
    margin-top: 4px;
    font-size: 13px;
    color: #667085;
}

.admin-order-summary {
    padding: 18px 20px 20px;
}

.admin-order-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
}

.admin-order-summary__row:last-child {
    border-bottom: 0;
}

.admin-order-methods {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 16px;
}

.admin-order-method__label,
.admin-order-address-block__title {
    font-size: 13px;
    font-weight: 800;
    color: #667085;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-info-list {
    padding: 8px 20px 20px;
}

.admin-info-list__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
}

.admin-info-list__item:last-child {
    border-bottom: 0;
}

.admin-info-list__item span {
    color: #667085;
}

.admin-order-addresses {
    padding: 8px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-order-address-block {
    font-size: 14px;
    line-height: 1.55;
    color: #17212b;
}

.admin-order-status-form {
    padding: 8px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-order-status-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid #d6dde8;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}

.admin-order-status-form textarea:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

@media (max-width: 1200px) {
    .admin-order-layout {
        grid-template-columns: 1fr;
    }

    .admin-order-side {
        position: static;
    }

    .admin-order-timeline,
    .admin-order-timeline--cancelled {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-order-timeline__item:nth-child(2n)::after {
        display: none;
    }
}

@media (max-width: 700px) {
    .admin-order-timeline,
    .admin-order-timeline--cancelled {
        grid-template-columns: 1fr;
    }

    .admin-order-timeline__item::after {
        display: none;
    }

    .admin-card__head {
        padding: 16px 16px 0;
    }

    .admin-order-summary,
    .admin-info-list,
    .admin-order-addresses,
    .admin-order-status-form {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* responsive */
@media (max-width: 1200px) {
    .admin-filters__grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 700px) {
    .admin-page__title {
        font-size: 28px;
    }

    .admin-filters__grid {
        grid-template-columns: 1fr;
    }

    .admin-filters__actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .admin-filters__actions .admin-btn {
        width: 100%;
    }
}
