/* Enhanced styling for Air Curtains GUI v3 -- shared design tokens +
   components, inspired by the BEZA reference (green accent, clean cards,
   rounded fields) but adapted to this app's own pages/navigation, not a
   literal copy. Every template below already links this file -- updating
   tokens/components here uplifts all of them at once. */

:root {
    --color-primary: #2e7d32;
    --color-primary-hover: #1b5e20;
    --color-primary-light: #e8f5e9;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-success-bg: #dcfce7;
    --color-success-text: #166534;
    --color-warning-bg: #fef9c3;
    --color-warning-text: #854d0e;
    --color-danger-bg: #fee2e2;
    --color-danger-text: #991b1b;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

/* Shared top bar: logo left, page nav center/left, icons right. Opt-in --
   only pages that add <div class="app-header">...</div> to their markup
   get it; existing plain <header><h1> blocks keep working untouched. */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    margin-bottom: 20px;
    margin-bottom: 24px;
}

.app-header .app-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.app-header .app-nav {
    display: flex;
    gap: 28px;
    flex: 1;
    margin-left: 40px;
}

.app-header .app-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.app-header .app-nav a:hover,
.app-header .app-nav a.active {
    color: var(--color-primary);
}

.app-header .app-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-ready {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-partial {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.status-failed {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.data-item {
    background: var(--color-bg);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.data-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.data-value {
    font-weight: 600;
    color: var(--color-text);
}

.table-container {
    overflow-x: auto;
    margin: 15px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-bg);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--color-border);
}

.data-table td {
    padding: 12px;
    border: 1px solid var(--color-border);
    vertical-align: top;
}

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

.data-table tr:hover {
    background: #f1f5f9;
}

/* Radio-select variant rows (e.g. the curtain-combination picker) --
   matches the reference's table-of-options-with-radio-select pattern. */
.data-table tr.selectable {
    cursor: pointer;
}

.data-table tr.selected {
    background: var(--color-primary-light);
}

.warning-box {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.warning-box.critical {
    border-color: #fca5a5;
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.warning-box.review {
    border-color: #fdba74;
    background: #ffedd5;
    color: #9a3412;
}

.file-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-link-card {
    background: var(--color-bg);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    text-align: center;
}

.file-link-card h4 {
    margin-bottom: 10px;
    color: var(--color-text);
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    margin: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

.btn-secondary {
    background: var(--color-border);
    color: #334155;
}

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

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.no-data {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Shared form field style (rounded box, label above, green focus ring) --
   matches the reference's input styling. Opt-in via .field-styled on the
   wrapping div; existing per-page field CSS is untouched otherwise. */
.field-styled {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.field-styled label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.field-styled input,
.field-styled select,
.field-styled textarea {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--color-text);
}

.field-styled input:focus,
.field-styled select:focus,
.field-styled textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}
