/* ========================================
   AUTHORITY RUNNING CHAMPIONSHIP 2026
   Clean, Light Athletic Theme
   Mobile-first responsive design
======================================== */

:root {
    /* Primary Palette - Clean Light */
    --bg-primary: #F4F6F9;
    --bg-card: #FFFFFF;
    --bg-input: #F0F2F5;
    --bg-section: #E8ECF0;

    /* Accent */
    --accent: #0066CC;
    --accent-light: #E8F2FF;
    --accent-border: rgba(0, 102, 204, 0.25);
    --accent-hover: #0055AA;

    /* Text */
    --text-primary: #1A1F2B;
    --text-secondary: #3D4555;
    --text-muted: #6B7385;
    --text-accent: var(--accent);

    /* Borders */
    --border: #D5DAE1;
    --border-light: #E4E8ED;
    --border-focus: var(--accent);

    /* Feedback */
    --success: #16A34A;
    --success-bg: #F0FDF4;
    --error: #DC2626;
    --error-bg: #FEF2F2;

    /* Typography */
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Outfit', sans-serif;

    /* Spacing */
    --sp-xs: 0.5rem;
    --sp-sm: 1rem;
    --sp-md: 1.5rem;
    --sp-lg: 2rem;
    --sp-xl: 3rem;

    /* Radius */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-btn: 0 4px 12px rgba(0, 102, 204, 0.25);

    /* Transitions */
    --t-fast: 0.2s ease;
    --t-med: 0.3s ease;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--sp-md);
    position: relative;
}

/* ========================================
   HEADER
======================================== */

.header {
    text-align: center;
    padding: var(--sp-lg) 0 var(--sp-md);
    animation: fadeSlideDown 0.6s ease both;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.logo-container {
    margin-bottom: var(--sp-md);
}

.logo {
    max-width: 240px;
    width: 100%;
    height: auto;
}

.welcome-text {
    animation: fadeIn 0.7s 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.title-ar {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.title-en {
    font-family: var(--font-english);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-sm);
}

.subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: var(--sp-xs) var(--sp-md);
    border-radius: var(--r-xl);
    display: inline-block;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   CATEGORY SELECTOR
======================================== */

.category-section {
    text-align: center;
    margin-bottom: var(--sp-lg);
    animation: fadeSlideUp 0.5s 0.2s both;
}

.category-section h3 {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: var(--sp-md);
    font-weight: 600;
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-sm);
}

.category-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-md) var(--sp-sm);
    cursor: pointer;
    transition: all var(--t-med);
    text-align: center;
}

.category-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

.category-card .card-label-ar {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-card .card-label-en {
    display: block;
    font-family: var(--font-english);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.category-card .card-distance {
    display: inline-block;
    font-family: var(--font-english);
    font-size: 0.82rem;
    padding: 4px 14px;
    background: var(--accent);
    color: var(--bg-card);
    border-radius: var(--r-xl);
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ========================================
   FORM CARD
======================================== */

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: var(--sp-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.5s 0.15s both;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.form-header {
    text-align: center;
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--border-light);
}

.form-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--sp-md);
}

.form-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-xs);
    margin-bottom: var(--sp-xs);
    font-weight: 600;
    font-size: 0.95rem;
}

.label-ar {
    color: var(--text-primary);
}

.label-divider {
    color: var(--border);
    font-weight: 400;
}

.label-en {
    font-family: var(--font-english);
    color: var(--text-secondary);
    font-weight: 600;
}

.required-star {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Inputs */
.form-input,
.form-select {
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    font-size: 1rem;
    font-family: var(--font-arabic);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--t-med);
    direction: rtl;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-bg);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7385' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
}

.input-hint {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: var(--sp-xs);
}

.error-message {
    display: none;
    font-size: 0.82rem;
    color: var(--error);
    margin-top: var(--sp-xs);
}

.error-message.show {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Radio Group (Gender) */
.radio-group {
    display: flex;
    gap: var(--sp-sm);
    margin-top: var(--sp-xs);
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    padding: var(--sp-sm);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-med);
    font-size: 0.92rem;
    text-align: center;
    color: var(--text-secondary);
}

.radio-option input[type="radio"]:checked + .radio-label {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.radio-label:hover {
    border-color: var(--accent-border);
}

/* Terms / Declaration */
.terms-group {
    background: var(--bg-section);
    padding: var(--sp-md);
    border-radius: var(--r-md);
    margin-top: var(--sp-lg);
    border: 1px solid var(--border-light);
}

.terms-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-xs);
    margin-bottom: var(--sp-sm);
    font-weight: 600;
}

.terms-content {
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    padding: var(--sp-md);
    margin-bottom: var(--sp-md);
    font-size: 0.9rem;
    line-height: 1.8;
    border: 1px solid var(--border-light);
}

.terms-content::-webkit-scrollbar {
    width: 5px;
}
.terms-content::-webkit-scrollbar-track {
    background: var(--bg-input);
}
.terms-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.terms-ar {
    margin-bottom: var(--sp-md);
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.terms-en {
    font-family: var(--font-english);
    color: var(--text-secondary);
    direction: ltr;
    text-align: left;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-sm);
    cursor: pointer;
    padding: var(--sp-sm);
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
}

.checkbox-container:hover {
    background: rgba(0, 102, 204, 0.04);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    background: var(--bg-card);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.92rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-xs);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: var(--sp-md) var(--sp-lg);
    font-size: 1.1rem;
    font-family: var(--font-arabic);
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--r-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    transition: all var(--t-med);
    box-shadow: var(--shadow-btn);
    margin-top: var(--sp-lg);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--r-xl);
    backdrop-filter: blur(2px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--sp-md);
}

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

.loading-overlay p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: var(--sp-xl);
}

.success-message.show {
    display: block;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0%   { opacity: 0; transform: scale(0.9); }
    60%  { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: var(--sp-md);
    color: var(--success);
}

.success-message h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.success-message h4 {
    font-family: var(--font-english);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--sp-md);
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: var(--sp-xs);
}

.new-registration-btn {
    margin-top: var(--sp-lg);
    padding: var(--sp-sm) var(--sp-lg);
    font-size: 1rem;
    font-family: var(--font-arabic);
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-med);
}

.new-registration-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--sp-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--t-fast);
}

.footer a:hover {
    opacity: 0.8;
}

/* ========================================
   CAPACITY CARDS (Admin)
======================================== */

.capacity-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
}

.capacity-card {
    background: var(--bg-card);
    border-radius: var(--r-lg);
    padding: var(--sp-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: border-color var(--t-med), box-shadow var(--t-med);
    text-align: center;
}

.capacity-card.cap-warning {
    border-color: #f0ad4e;
    box-shadow: 0 0 0 1px rgba(240, 173, 78, 0.25), var(--shadow-card);
}

.capacity-card.cap-full {
    border-color: #e74c3c;
    box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.25), var(--shadow-card);
}

.cap-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--sp-sm);
}

.cap-label-ar {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cap-label-en {
    font-size: 0.8rem;
    font-family: var(--font-english);
    color: var(--text-muted);
    font-weight: 500;
}

.cap-count {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-english);
    color: var(--accent);
    line-height: 1.1;
}

.cap-full .cap-count {
    color: #e74c3c;
}

.cap-warning .cap-count {
    color: #e67e22;
}

.cap-limit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.cap-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: var(--sp-sm);
}

.cap-bar {
    height: 6px;
    background: var(--bg-section);
    border-radius: 3px;
    overflow: hidden;
}

.cap-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #00a8ff);
    transition: width 0.6s ease;
}

.cap-warning .cap-bar-fill {
    background: linear-gradient(90deg, #f0ad4e, #e67e22);
}

.cap-full .cap-bar-fill {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* ========================================
   ADMIN PAGE
======================================== */

.admin-container {
    max-width: 1200px;
    padding: var(--sp-lg);
}

.admin-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
}

.admin-header .logo {
    max-width: 180px;
}

.admin-title {
    text-align: center;
}

.admin-title h1 {
    font-size: 1.35rem;
    color: var(--text-primary);
}

.admin-title p {
    font-family: var(--font-english);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Category Toggle */
.category-toggle {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--r-md);
    padding: 4px;
    gap: 4px;
    margin-bottom: var(--sp-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.toggle-btn {
    flex: 1;
    padding: var(--sp-sm) var(--sp-md);
    font-size: 0.92rem;
    font-family: var(--font-arabic);
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-med);
    white-space: nowrap;
    text-align: center;
}

.toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-section);
}

.toggle-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

/* Admin Controls */
.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
    margin-bottom: var(--sp-lg);
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-sm) var(--sp-md);
    font-size: 0.95rem;
    font-family: var(--font-arabic);
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-med);
}

.refresh-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn);
}

.refresh-btn.loading .refresh-icon {
    animation: spin 0.8s linear infinite;
}

.stats-display {
    display: flex;
    gap: var(--sp-md);
}

.stat-item {
    background: var(--bg-card);
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--r-sm);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

/* Table Card */
.table-card {
    background: var(--bg-card);
    border-radius: var(--r-lg);
    padding: var(--sp-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Filter Row */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--sp-sm);
    padding: var(--sp-md);
    background: var(--bg-section);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-md);
    border: 1px solid var(--border-light);
}

.filter-input {
    padding: var(--sp-sm);
    font-size: 0.88rem;
    font-family: var(--font-arabic);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--t-fast);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-input::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.data-table th,
.data-table td {
    padding: var(--sp-sm) var(--sp-md);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table th {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
    font-size: 0.9rem;
}

.data-table th:first-child {
    border-radius: 0 var(--r-sm) 0 0;
}

.data-table th:last-child {
    border-radius: var(--r-sm) 0 0 0;
}

.data-table tbody tr {
    transition: background var(--t-fast);
}

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

.data-table tbody tr:nth-child(even) {
    background: var(--bg-primary);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--accent-light);
}

.data-table td {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--sp-xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--sp-md);
    opacity: 0.4;
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */

@media (max-width: 600px) {
    :root { font-size: 15px; }

    .container { padding: var(--sp-sm); }

    .form-card {
        padding: var(--sp-md);
        border-radius: var(--r-lg);
    }

    .title-ar { font-size: 1.3rem; }
    .title-en { font-size: 1.05rem; }
    .logo { max-width: 200px; }

    .category-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-card {
        display: flex;
        align-items: center;
        gap: var(--sp-sm);
        padding: var(--sp-sm) var(--sp-md);
        text-align: right;
    }

    .category-card .card-label-ar {
        margin-bottom: 0;
    }

    .category-card .card-label-en {
        margin-bottom: 0;
    }

    .category-card .card-distance {
        margin-right: auto;
    }

    .radio-group {
        flex-direction: row;
    }

    .form-input, .form-select {
        padding: var(--sp-sm);
    }

    .submit-btn {
        padding: var(--sp-sm) var(--sp-md);
        font-size: 1.05rem;
    }

    .terms-content {
        max-height: 140px;
    }

    /* Admin Mobile */
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .category-toggle {
        flex-direction: column;
    }

    .capacity-cards {
        grid-template-columns: 1fr;
    }

    .stats-display {
        justify-content: center;
    }

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

@media (max-width: 900px) and (orientation: landscape) {
    .header { padding: var(--sp-sm) 0; }
    .logo { max-width: 140px; }
    .welcome-text { display: none; }
}

/* Print */
@media print {
    .admin-controls,
    .category-toggle,
    .filter-row {
        display: none !important;
    }

    body { background: #fff; }

    .table-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .data-table th {
        background: #333 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================
   ADDITIONS (self-hosted backend)
   ======================================== */

/* Honeypot: off-screen, not display:none (some bots skip those) */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.success-icon-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    font-size: 1.6rem;
}

.category-card:focus-visible { outline: 3px solid #0066CC; outline-offset: 2px; }

.hidden { display: none !important; }

.login-card {
    max-width: 420px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(15, 25, 35, 0.12);
}
.login-card h2 { margin-bottom: 1.25rem; text-align: center; }
.login-card .form-group { margin-bottom: 1rem; }
.login-error { color: #c0392b; min-height: 1.4em; margin-bottom: 0.75rem; text-align: center; font-size: 0.95rem; }

.admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.action-btn {
    padding: 0.55rem 1rem;
    border: 1px solid #d0d7e2;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    color: #1A1F2B;
}
.action-btn:hover { background: #f0f4fa; }
.action-btn.danger { color: #c0392b; border-color: #e8b4ae; padding: 0.25rem 0.6rem; }
.action-btn.danger:hover { background: #fdecea; }
.action-btn:disabled { opacity: 0.5; cursor: default; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
