
:root {
    --color-primary: #182C52;       /* sidebar / table header dark green */
    --color-primary-dark: #13213b;  /* sidebar top strip, slightly darker */
    --color-accent: #E0AA3E;        /* buttons, links, active states — bronze/gold */
    --color-accent-hover: #8f6d39;
    --color-accent-light: #f5ecdb;  /* price pill background — soft gold tint */
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-border: #e5e7eb;        /* table/cell borders */
    --color-row-hover: #f5f7fb;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --h1-color: #182C52;
    --radius: 0.5rem;
}

h1 {
    color: var(--h1-color) !important;
}
/* Alpine adds the x-cloak attribute on page load and removes it once it's
   initialized. Without this rule, x-cloak does nothing and elements using
   it (like modals) briefly flash visible before Alpine hides them. */
[x-cloak] {
    display: none !important;
}

/* ---------- Form groups (used in login + add/edit modals) ---------- */
.admin-form-group {
    margin-bottom: 1rem;
}

.admin-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.admin-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.admin-form-group select[multiple] {
    padding: 0.25rem;
}

.admin-form-group select[multiple] option {
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
}

.admin-form-group select[multiple] option:checked {
    background-color: var(--color-accent);
    color: #ffffff;
}

/* ---------- Buttons ---------- */
.btn-accent {
    background-color: var(--color-accent);
    color: #ffffff;
    font-weight: 500;
    transition: background-color 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: var(--color-text);
    font-weight: 500;
    transition: background-color 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
    font-weight: 500;
    transition: background-color 0.15s ease;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: var(--color-danger-hover);
}

.icon-warning-circle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background-color: rgba(220, 38, 38, 0.12);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background-color: rgba(30, 64, 175, 0.08);
}

/* ---------- Modal ---------- */
.admin-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.admin-modal {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header-accent {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 1rem 1.5rem;
}

.modal-header-accent h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* ---------- Toast ---------- */
.admin-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.admin-toast svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.admin-toast-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    border-left-color: #059669;
    color: #065f46;
}

.admin-toast-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    border-left-color: #dc2626;
    color: #991b1b;
}

/* ---------- Table (grid lines between rows AND columns) ---------- */
table.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

table.admin-table thead th {
    background-color: var(--color-primary);
    color: #ffffff;
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

table.admin-table thead th:last-child {
    border-right: none;
}

table.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

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

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

table.admin-table tbody tr:hover {
    background-color: var(--color-row-hover);
}

.table-price-pill {
    display: inline-block;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
}

/* Truncate long descriptions instead of stretching the row/column. */
.table-desc-cell {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- Custom tooltip (used on truncated descriptions) ----------
   IMPORTANT: [data-tooltip] must NOT also have overflow:hidden on it —
   that would clip its own ::after tooltip. Truncation lives on the
   inner .table-desc-cell span instead; this wrapper just positions
   the tooltip. */
[data-tooltip] {
    position: relative;
    cursor: default;
    display: inline-block;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 0;
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 50;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 14px;
    margin-bottom: -1px;
    border: 5px solid transparent;
    border-top-color: var(--color-primary);
    z-index: 50;
    pointer-events: none;
}

/* ---------- Icon action buttons ---------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
    background: none;
}

.icon-btn.edit {
    color: var(--color-accent);
}

.icon-btn.edit:hover {
    background-color: rgba(30, 64, 175, 0.1);
}

.icon-btn.delete {
    color: var(--color-danger);
}

.icon-btn.delete:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

/* ---------- DataTables overrides (search box + pagination) ---------- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius) !important;
    padding: 0.3rem 0.7rem !important;
    margin-left: 0.25rem !important;
    border: 1px solid transparent !important;
    color: var(--color-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-accent) !important;
    color: #ffffff !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* ---------- Print (used by the Reports page) ---------- */
@media print {
    @page {
        margin: 0;
    }
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    body * {
        visibility: hidden;
    }
    .print-report, .print-report * {
        visibility: visible;
    }
    .print-report {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 1.5rem !important;
        margin: 0 !important;
        background: white !important;
        box-shadow: none !important;
    }
    .no-print {
        display: none !important;
    }
}

.admin-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.admin-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb, 0,0,0), 0.1);
}

.admin-input.is-invalid {
    border-color: #ef4444;
}

.admin-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
