/* =============================================
   Seabird Admin Stylesheet
   Professional, clean admin interface
   admin.markwromanowitz.com/css/admin.css
   ============================================= */

/* Font Declarations */
@font-face {
    font-family: 'Bruney';
    src: url('../fonts/bruney_Bh91kBnS76.woff') format('woff'),
         url('../fonts/bruney_Bh91kBnS76.otf') format('opentype'),
         url('../fonts/bruney_Bh91kBnS76.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Base Variables - Seabird Branding
   Light theme. The [data-theme="dark"] block below overrides surfaces and
   text; js/theme.js sets the attribute before first paint.

   --brand is the navy used as a SURFACE (buttons, sidebar) and never changes.
   --primary-color is the navy used as TEXT (headings, labels, links) and
   lightens in dark mode so it stays readable on dark cards. */
:root {
    color-scheme: light;

    --brand: #2E4A62;
    --brand-hover: #234056;
    --primary-color: #2E4A62;
    --secondary-color: #5C6670;      /* muted text; was #B4B7BA (2:1 on white, unreadable) */
    --secondary-surface: #B4B7BA;    /* the old gray, kept for button/surface use */
    --accent-color: #C0AB8E;
    --text-color: #333333;
    --light-text: #FFFFFF;

    --page-bg: #F5F7FA;              /* behind everything */
    --card-bg: #FFFFFF;              /* cards, tables, header bar, modals */
    --light-bg: #F5F7FA;             /* panels inside cards: table heads, note boxes */
    --input-bg: #FFFFFF;
    --hover-bg: #F0F0F0;
    --border-color: #E1E4E8;
    --shadow-color: rgba(0, 0, 0, 0.05);

    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --info-color: #17A2B8;
    --error-color: #DC3545;

    /* Badge / alert tints */
    --tint-success-bg: #D4EDDA;  --tint-success-fg: #155724;  --tint-success-border: #C3E6CB;
    --tint-warning-bg: #FFF3CD;  --tint-warning-fg: #856404;  --tint-warning-border: #FFEAA7;
    --tint-danger-bg:  #F8D7DA;  --tint-danger-fg:  #721C24;  --tint-danger-border:  #F5C6CB;
    --tint-info-bg:    #D1ECF1;  --tint-info-fg:    #0C5460;  --tint-info-border:    #BEE5EB;
    
    --header-font: 'Bruney', Georgia, 'Times New Roman', serif;
    --text-font: 'Afacad Flux', sans-serif;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition-speed: 0.2s;
    --main-sidebar-gap: 30px;
}

/* =============================================
   DARK THEME
   Applied via <html data-theme="dark"> (js/theme.js, before first paint).
   Only colors change; layout and type are shared.
   ============================================= */
:root[data-theme="dark"] {
    color-scheme: dark;

    --primary-color: #9FC1E3;        /* navy-as-text lightens; --brand stays navy */
    --secondary-color: #A3ADB8;
    --secondary-surface: #4A5563;
    --accent-color: #D2BE9F;
    --text-color: #E6E9ED;

    --page-bg: #171C23;
    --card-bg: #222A33;
    --light-bg: #2A333E;
    --input-bg: #1B2129;
    --hover-bg: #2F3945;
    --border-color: #3A4450;
    --shadow-color: rgba(0, 0, 0, 0.4);

    --tint-success-bg: rgba(40, 167, 69, 0.18);   --tint-success-fg: #8FE0A4;  --tint-success-border: rgba(40, 167, 69, 0.4);
    --tint-warning-bg: rgba(255, 193, 7, 0.16);   --tint-warning-fg: #F3D37A;  --tint-warning-border: rgba(255, 193, 7, 0.4);
    --tint-danger-bg:  rgba(220, 53, 69, 0.18);   --tint-danger-fg:  #F19AA3;  --tint-danger-border:  rgba(220, 53, 69, 0.4);
    --tint-info-bg:    rgba(23, 162, 184, 0.18);  --tint-info-fg:    #8ADCE8;  --tint-info-border:    rgba(23, 162, 184, 0.4);
}

/* Inline light backgrounds in page markup (note boxes, callouts) would be
   light panels with light text in dark mode. Bridge them until the
   inline-style sweep moves them to classes. */
:root[data-theme="dark"] [style*="background: #e3f2fd"],
:root[data-theme="dark"] [style*="background: #e8f5e9"],
:root[data-theme="dark"] [style*="background: #fff8e6"],
:root[data-theme="dark"] [style*="background: #fff3cd"],
:root[data-theme="dark"] [style*="background: #f8f9fa"],
:root[data-theme="dark"] [style*="background: #f9f9f9"],
:root[data-theme="dark"] [style*="background: white"],
:root[data-theme="dark"] [style*="background: #fff"],
:root[data-theme="dark"] [style*="background-color: white"],
:root[data-theme="dark"] [style*="background-color: #fff"] {
    background: var(--light-bg) !important;
    color: var(--text-color);
}

:root[data-theme="dark"] [style*="color: #2e7d32"],
:root[data-theme="dark"] [style*="color: #155724"] {
    color: var(--tint-success-fg) !important;
}

:root[data-theme="dark"] img {
    opacity: 0.92;
}

/* Theme toggle - lives on the sidebar's Dashboard row (sidebar.php) */
.nav-dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.75rem;
}

.nav-dashboard-row .nav-item {
    flex: 1;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.3rem 0.7rem;
    font-family: var(--text-font);
    font-size: 0.8rem;
    color: var(--light-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-speed) ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.theme-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--text-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--page-bg);
}

/* Browser default for <small> is ~12.5px at this base size; too small for data tables */
small {
    font-size: 0.9rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--header-font);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; color: var(--primary-color); }
h2 { font-size: 1.75rem; color: var(--primary-color); }
h3 { font-size: 1.5rem; color: var(--primary-color); }
h4 { font-size: 1.25rem; color: var(--primary-color); }

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--primary-color);
}

/* =============================================
   LAYOUT
   ============================================= */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--brand);
    color: var(--light-text);
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
}

.admin-sidebar::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);   /* on the dark sidebar, not --secondary-color */
    font-weight: 600;
}

.nav-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--light-text);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
}

.nav-item.active {
    background: rgba(192, 171, 142, 0.15);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
}

.nav-badge {
    display: inline-block;
    min-width: 1.4em;
    padding: 0.1em 0.45em;
    margin-left: 0.5rem;
    border-radius: 999px;
    background: var(--warning-color);
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--main-sidebar-gap);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.admin-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.header-title {
    font-family: var(--header-font);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: 50px;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.user-menu:hover {
    background: var(--border-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Content Area */
.admin-content {
    padding: 2rem;
    flex: 1;
}

/* =============================================
   COMPONENTS
   ============================================= */

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-family: var(--header-font);
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
}

.card-body {
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-family: var(--text-font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    text-align: center;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--brand);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-hover);
}

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

.btn-accent:hover:not(:disabled) {
    background: #a89476;
}

.btn-secondary {
    background: var(--secondary-surface);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #9a9da0;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: box-shadow var(--transition-speed) ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--header-font);
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.data-table th {
    background: var(--light-bg);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background var(--transition-speed) ease;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: var(--tint-success-bg);
    color: var(--tint-success-fg);
}

.badge-warning {
    background: var(--tint-warning-bg);
    color: var(--tint-warning-fg);
}

.badge-danger {
    background: var(--tint-danger-bg);
    color: var(--tint-danger-fg);
}

.badge-info {
    background: var(--tint-info-bg);
    color: var(--tint-info-fg);
}

.badge-secondary {
    background: var(--light-bg);
    color: var(--text-color);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--text-font);
    font-size: 0.95rem;
    transition: border-color var(--transition-speed) ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(46, 74, 98, 0.1);
}

.form-control:disabled {
    background: var(--light-bg);
    cursor: not-allowed;
}

.form-controldate {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--text-font);
    font-size: 0.95rem;
    transition: border-color var(--transition-speed) ease;
    background: var(--input-bg);
    color: var(--text-color);
}

/* Inline Form Elements */
.form-inline {
    display: inline;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.form-inline .form-label {
    display: inline;
    margin-bottom: 0;
    margin-right: 0.5rem;
}

.form-control-sm {
    width: auto;
    min-width: 150px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    transition: border-color var(--transition-speed) ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--accent-color);
}

.file-upload.drag-over {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-text {
    color: var(--secondary-color);
}

.file-preview {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-preview-item {
    position: relative;
    width: 150px;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--tint-success-bg);
    border-color: var(--tint-success-border);
    color: var(--tint-success-fg);
}

.alert-warning {
    background: var(--tint-warning-bg);
    border-color: var(--tint-warning-border);
    color: var(--tint-warning-fg);
}

.alert-danger {
    background: var(--tint-danger-bg);
    border-color: var(--tint-danger-border);
    color: var(--tint-danger-fg);
}

.alert-info {
    background: var(--tint-info-bg);
    border-color: var(--tint-info-border);
    color: var(--tint-info-fg);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    transition: all var(--transition-speed) ease;
}

.page-link:hover {
    background: var(--light-bg);
}

.page-link.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================
   MODAL — site-wide convention (see admin.js)
   .modal is the dimmed full-screen layer; .show displays it.
   .modal-overlay / .modal-backdrop are optional click-to-close layers
   some pages place inside .modal; admin.js treats a click on either,
   or on .modal itself, as "close".
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay,
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content.modal-sm { max-width: 420px; }
.modal-content.modal-lg { max-width: 820px; }

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Inline error block inside a modal body (editions status modal, etc.) */
.modal-error {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--tint-danger-bg);
    color: var(--tint-danger-fg);
    border: 1px solid var(--tint-danger-border);
}

.modal-error.show {
    display: block;
}

/* Note box inside a modal (warnings, auto-fill previews) */
.modal-note {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--tint-warning-bg);
    color: var(--tint-warning-fg);
    border: 1px solid var(--tint-warning-border);
}

.modal-note.modal-note-success {
    background: var(--tint-success-bg);
    color: var(--tint-success-fg);
    border-color: var(--tint-success-border);
}

.modal-note[hidden] { display: none; }

.modal-note-title {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--header-font);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* =============================================
   EDITION SELECTOR (js/editionselection.js)
   Injected .modal; these style the body it renders.
   Moved here from an injected <style> block, Nov 6 2026.
   ============================================= */
.edition-selector .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.edition-product-info { margin-bottom: 1rem; }

.edition-product-name {
    font-weight: 600;
    font-size: 1rem;
}

.edition-product-meta {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.edition-reserved-box {
    background: var(--tint-success-bg);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.edition-reserved-title {
    font-weight: bold;
    color: var(--tint-success-fg);
    margin-bottom: 0.5rem;
}

.edition-pick { margin-top: 1rem; }

.edition-number-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.edition-number-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.edition-number-item:hover { background: var(--hover-bg); }
.edition-number-item:last-child { border-bottom: none; }

.edition-number-item input[type="radio"] {
    margin-right: 0.75rem;
    margin-top: 0.2rem;
}

.edition-number-defer { color: var(--secondary-color); }

.edition-defer-option {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.edition-contingency-badge {
    color: var(--warning-color);
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.edition-reserved-badge { color: var(--tint-success-fg); }

.edition-notes {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.edition-loading,
.edition-error {
    text-align: center;
    padding: 2rem;
}

.edition-error { color: var(--danger-color); }

.edition-no-numbers {
    padding: 1.5rem;
    text-align: center;
    color: var(--tint-danger-fg);
    background: var(--tint-danger-bg);
    border-radius: 4px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }
.mr-3 { margin-right: 1.5rem; }
.mr-4 { margin-right: 2rem; }

.d-flex { display: flex; }
.d-inlineb { display: inline-block}
.d-block { display: block}
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        padding: 0 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

/* Print Styles */
@media print {
    .admin-sidebar,
    .admin-header,
    .btn,
    .pagination {
        display: none !important;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-content {
        padding: 0;
    }

    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-checkbox span {
    font-weight: 500;
    color: var(--primary-color);
}

/* =============================================
   TOGGLE SWITCH
   Used by: editions/list.php (active toggle)
   ============================================= */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-surface);
    transition: background-color 0.3s ease;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success-color, #4caf50);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* =============================================
   EDITION NUMBER TILES
   Used by: editions/manage.php
   ============================================= */

.number-checkbox:checked + .number-label {
    background: var(--brand);
    color: white;
    font-weight: bold;
}

label:has(.number-checkbox:checked) {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: white;
}

label:has(.number-checkbox):hover {
    border-color: var(--brand);
    transform: scale(1.05);
}

.edition-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* =============================================
   BADGE VARIANTS
   ============================================= */

.badge-accent {
    background-color: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* =============================================
   BATCH PRINT STEPPER
   Used by: fulfillment/batchprint.php
   ============================================= */

.batch-steps {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.batch-step {
    flex: 1;
    padding: 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--secondary-color);
    background: var(--light-bg);
    border-right: 1px solid var(--border-color);
}

.batch-step:last-child {
    border-right: none;
}

.batch-step.active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
}

.batch-step.done {
    background: var(--card-bg);
    color: var(--success-color);
}

.step-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

.batch-step.active .step-num {
    background: rgba(255, 255, 255, 0.3);
}

.batch-step.done .step-num {
    background: var(--success-color);
    color: #fff;
}

/* =============================================
   COMMENT ITEMS
   Used by: blog/comments.php
   ============================================= */

.comment-item:last-child {
    border-bottom: none !important;
}

.comment-item:hover {
    background: var(--light-bg);
}

/* =============================================
   TABLE ROW STATE CLASSES
   ============================================= */

.inactive-row {
    opacity: 0.6;
    background-color: var(--light-bg);
}

/* =============================================
   TEXT UTILITIES
   ============================================= */

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-secondary { color: var(--secondary-color); }
.text-sm { font-size: 0.85rem; }
.text-accent { color: var(--accent-color); }


/* =============================================
   IMAGE DISPLAY
   Used by: images/display.php
   ============================================= */

.img-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.img-thumb:hover {
    transform: scale(1.1);
}

.primary-star {
    position: absolute;
    top: -4px;
    right: -4px;
    color: #ffc107;
    font-size: 1rem;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.order-input {
    width: 60px;
    text-align: center;
    padding: 0.25rem;
}

.printer-ref-input {
    width: 100%;
    font-size: 0.85rem;
}

.printer-ref-input.missing-ref {
    background-color: var(--tint-warning-bg);
    border-color: var(--warning-color);
}

.printer-ref-input.missing-ref:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

/* =============================================
   SORTABLE TABLE COLUMNS
   ============================================= */

.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable:hover {
    background-color: var(--hover-bg);
}

.sort-icon {
    color: var(--secondary-surface);
    font-size: 0.8rem;
    margin-left: 4px;
}

.sortable.sort-asc .sort-icon,
.sortable.sort-desc .sort-icon {
    color: var(--primary-color);
}

/* =============================================
   SAVING INDICATOR
   ============================================= */

.saving-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.saving-indicator.error {
    background: var(--danger-color);
}

.saving-indicator.success {
    background: var(--success-color);
}

/* =============================================
   LIGHTBOX
   ============================================= */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* =============================================
   VISIBILITY UTILITY
   ============================================= */

.hidden {
    display: none !important;
}

/* =============================================
   DROPDOWN MENUS
   ============================================= */

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

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 100;
    padding: 0.25rem 0;
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--light-bg);
}

.dropdown-divider {
    height: 0;
    margin: 0.25rem 0;
    border-top: 1px solid var(--border-color);
}

.dropdown-form {
    padding: 0.5rem 1rem;
}

/* =============================================
   VIEW LAYOUT (Two Column)
   ============================================= */

.view-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .view-layout {
        grid-template-columns: 1fr;
    }

    .view-sidebar {
        order: -1;
    }
}

.view-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.view-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =============================================
   INFO LIST (Definition List Style)
   ============================================= */

.info-list {
    margin: 0;
}

.info-list dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-top: 0.75rem;
}

.info-list dt:first-child {
    margin-top: 0;
}

.info-list dd {
    margin: 0.25rem 0 0 0;
    color: var(--text-color);
}

.info-list-compact dt {
    margin-top: 0.5rem;
    font-size: 0.7rem;
}

.info-list-compact dd {
    font-size: 0.875rem;
}

/* =============================================
   FILTERS BAR
   ============================================= */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =============================================
   ADDITIONAL COMPONENT VARIANTS
   ============================================= */

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
    font-size: 0.875rem;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
}

.badge-error {
    background: var(--tint-danger-bg);
    color: var(--tint-danger-fg);
}

.badge-muted {
    background: var(--light-bg);
    color: var(--secondary-color);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    flex-shrink: 0;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    padding: 0.5rem;
    border: none;
}

.btn-text:hover {
    background: var(--light-bg);
}

.btn-warning {
    background: var(--warning-color);
    color: #333333;   /* yellow needs dark text in both themes */
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.text-muted {
    color: var(--secondary-color);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

.form-actions {
    margin-top: 1rem;
}

.action-form {
    margin-bottom: 0;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.header-left h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.pagination-info {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* =============================================
   SORTABLE COLUMN LINKS
   Extends .sortable from IMAGE DISPLAY section
   ============================================= */

.sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sortable a:hover {
    color: var(--primary-color);
}

.sort-indicator {
    font-size: 0.85em;
}

.sort-inactive {
    opacity: 0.3;
}

.sort-active {
    color: var(--primary-color);
}

/* =============================================
   DETAIL TABLE (Property/Value Layout)
   Used by: originals/view.php, reusable
   ============================================= */

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    font-weight: 600;
    width: 30%;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.detail-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
    border-bottom: none;
}


/* =============================================
   DETAIL GRID (Label/Value Layout)
   Used by: payments/view.php, reusable
   ============================================= */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-color);
}

.detail-value a {
    color: var(--primary-color);
    font-weight: 600;
}

.detail-value a:hover {
    color: var(--accent-color);
}


/* =============================================
   DISMISSIBLE ALERTS
   Pair with .alert-persistent so admin.js doesn't auto-hide them.
   Used by fulfillment/view.php for reported issues.
   ============================================= */

.alert-dismissible {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-dismissible .alert-dismiss {
    margin-left: auto;
    flex: 0 0 auto;
}













