/* ── Admin table ─────────────────────────────────────── */
.admin-page {
    overflow-x: auto;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.admin-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.admin-page-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.admin-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
}

.admin-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-filter-bar input,
.admin-filter-bar select {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fff;
}

.admin-filter-bar input { flex: 1; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 0.875rem;
}

.admin-table thead tr {
    background: #1a1a2e;
    color: #fff;
}

.admin-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

.admin-table td.truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Resizable columns (handles added by app.js) ─────── */
.admin-table th { position: relative; }

.admin-table .col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}

.admin-table .col-resizer:hover,
.admin-table .col-resizer.active { background: rgba(255,255,255,0.35); }

.admin-table.resized { table-layout: fixed; }
.admin-table.resized th { overflow: hidden; text-overflow: ellipsis; }
.admin-table.resized td.truncate { max-width: none; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-grey   { background: #f1f5f9; color: #475569; }

/* ── Action buttons ──────────────────────────────────── */
.btn-action {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 4px;
    color: #374151;
}

.btn-action:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-action-danger {
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-action-danger:hover { background: #fef2f2; }

.btn-primary {
    background: #0f3460;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover { background: #1a4a7a; }

.btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-secondary:hover { background: #f8fafc; }

/* ── Nav admin links (sidebar) ───────────────────────── */
.nav-admin-link {
    display: block;
    padding: 6px 10px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.nav-admin-link:hover { background: rgba(255,255,255,0.07); color: #e2e8f0; }
.nav-admin-link.active { background: #0f3460; color: #fff; }

/* ── Drawer panel ────────────────────────────────────── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 900;
}

.drawer-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 480px;
    max-width: 100%;
    background: #fff;
    box-shadow: -4px 0 32px rgba(0,0,0,0.15);
    z-index: 901;
    display: flex;
    flex-direction: column;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.drawer-close:hover { background: #f1f5f9; color: #374151; }

.drawer-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Delete confirm (small inline modal) ─────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    border-radius: 10px;
    width: 400px;
    max-width: 95%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.modal-close:hover { background: #f1f5f9; color: #374151; }

.modal-body {
    padding: 20px 24px 24px;
}

/* ── Form fields inside modals ───────────────────────── */
.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-field input[type=text],
.form-field input[type=password],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

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

.form-field input[readonly],
.form-field input[disabled] { background: #f8fafc; color: #64748b; }

.form-field-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.form-field-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.form-field-check label { font-size: 0.875rem; color: #374151; cursor: pointer; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 14px;
}

.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ── Breadcrumb ──────────────────────────────────────── */
.admin-breadcrumb {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
}

.admin-breadcrumb a { color: #0f3460; text-decoration: none; }
.admin-breadcrumb a:hover { text-decoration: underline; }
