/*
 * Plugin-specific styles only.
 * Tailwind utilities are provided by Tailwind itself in templates/components/header.php.
 */

:root {
    --er-brand: #1d4ed8;
    --er-brand-soft: #eff6ff;
    --er-dark: #111827;
    --er-muted: #6b7280;
    --er-border: #e5e7eb;
    --er-panel: #ffffff;
    --er-page: #f8fafc;
}

html,
body {
    margin-top: 0 !important;
}

body {
    background: var(--er-page);
}

.admin-panel {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 28rem),
        var(--er-page);
}

.sidebar {
    overflow-y: auto;
    border-right: 1px solid var(--er-border);
    box-shadow: 8px 0 24px rgba(15, 23, 42, .04);
    transition: transform .25s ease;
}

.sidebar img {
    max-height: 72px;
    object-fit: contain;
}

.nav-item {
    color: var(--er-dark);
    text-decoration: none;
}

.nav-item-inner {
    min-height: 44px;
    border-radius: 10px;
    color: #334155;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nav-item.active .nav-item-inner,
.nav-item-inner:hover {
    background: var(--er-brand-soft);
    color: var(--er-brand);
}

.nav-item.active .nav-item-inner {
    box-shadow: inset 3px 0 0 var(--er-brand);
    font-weight: 700;
}

.nav-item-inner:hover {
    transform: translateX(2px);
}

.sidebar-text {
    font-size: 14px;
    line-height: 1.25rem;
}

.btn,
.btn-sm {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.btn-primary {
    background: var(--er-brand);
    color: #fff;
    box-shadow: 0 10px 20px rgba(29, 78, 216, .18);
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--er-dark);
}

.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.form-input,
.form-select,
.form-textarea,
.option-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: var(--er-dark);
    font: inherit;
    padding: 9px 12px;
    max-width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.option-input:focus {
    outline: 2px solid rgba(29, 78, 216, .25);
    border-color: var(--er-brand);
}

.form-textarea {
    min-height: 120px;
    width: 100%;
}

.card {
    background: var(--er-panel);
    border: 1px solid var(--er-border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.er-stat-card {
    position: relative;
    overflow: hidden;
}

.er-stat-card::after {
    content: "";
    position: absolute;
    inset: auto 18px 0 18px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, rgba(29, 78, 216, .2), rgba(20, 184, 166, .22));
}

.er-table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--er-panel);
    border: 1px solid var(--er-border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.card .er-table-responsive {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.er-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.er-table th,
.er-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.er-table th {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: #f8fafc;
}

.er-table tbody tr {
    transition: background-color .16s ease;
}

.er-table tbody tr:hover {
    background: #f8fafc;
}

.er-table tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-cancel {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.text-er-icon {
    color: var(--er-brand);
}

.er-text-label {
    color: var(--er-dark);
    font-weight: 600;
}

#addOrderModal:not(.hidden),
#er-modalBackdrop:not(.hidden) {
    display: flex !important;
}

.er-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.er-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--er-border);
    border-radius: 8px;
    background: var(--er-panel);
    color: var(--er-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.er-pagination .page-link:hover {
    border-color: var(--er-brand);
    color: var(--er-brand);
    background: var(--er-brand-soft);
}

.er-pagination .page-link.active {
    border-color: var(--er-brand);
    background: var(--er-brand);
    color: #fff;
}

.er-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--er-muted);
    font-size: 14px;
}

@media (max-width: 767px) {
    #main-content {
        margin-left: 0 !important;
    }

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

    .sidebar.open {
        transform: translateX(0);
    }
}
