/* WIPReports global stylesheet
   - Brand color tokens via CSS custom properties
   - Component classes for repeated Tailwind clusters
   - Tailwind utilities still drive most layout; this file owns design tokens + composites
*/

:root {
    /* Brand */
    --color-brand: #2563eb;
    --color-brand-hover: #1d4ed8;
    --color-brand-light: #dbeafe;
    --color-brand-bg: #eff6ff;

    /* Surfaces / borders */
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-input: #d1d5db;

    /* Text */
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-soft: #9ca3af;

    /* Status */
    --color-success-bg: #f0fdf4;
    --color-success-border: #bbf7d0;
    --color-success-text: #15803d;

    --color-error-bg: #fef2f2;
    --color-error-border: #fecaca;
    --color-error-text: #b91c1c;

    --color-warning-bg: #fff7ed;
    --color-warning-border: #fed7aa;
    --color-warning-text: #c2410c;

    --color-info-bg: #eff6ff;
    --color-info-border: #bfdbfe;
    --color-info-text: #1d4ed8;

    /* Sizing */
    --radius: 0.25rem;
    --radius-lg: 0.5rem;
}

/* Page setup */
html { scroll-behavior: smooth; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border-input);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
.spinner-lg { width: 24px; height: 24px; border-width: 3px; }

/* ---- Component classes ---- */

/* Buttons */
.btn-primary {
    background: var(--color-brand);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}
.btn-primary:hover { background: var(--color-brand-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary-block { display: block; width: 100%; }

.btn-secondary {
    background: #f3f4f6;
    border: 1px solid var(--color-border-input);
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
}
.btn-secondary:hover { background: #e5e7eb; }

/* Inputs */
.input {
    width: 100%;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text);
}
.input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-brand);
    border-color: transparent;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-narrow {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 28rem;
}

/* Alerts (in-page banners) */
.alert {
    font-size: 0.875rem;
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success-text); }
.alert-error   { background: var(--color-error-bg);   border-color: var(--color-error-border);   color: var(--color-error-text); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.alert-info    { background: var(--color-info-bg);    border-color: var(--color-info-border);    color: var(--color-info-text); }

/* Notification stack (statusbar) */
.notifications {
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}
.notification {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    padding: 0.75rem;
    border: 1px solid;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    animation: slideInRight 0.15s ease-out;
}
.notification.dismissing { animation: fadeOutRight 0.15s ease-out forwards; }
.notification-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success-text); }
.notification-error   { background: var(--color-error-bg);   border-color: var(--color-error-border);   color: var(--color-error-text); }
.notification-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.notification-info    { background: var(--color-info-bg);    border-color: var(--color-info-border);    color: var(--color-info-text); }
.notification-message { flex: 1; min-width: 0; word-wrap: break-word; line-height: 1.4; }
.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.5rem;
}
.notification-close:hover { opacity: 1; }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOutRight {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(20%);  opacity: 0; }
}

/* Layout helpers */
.page-wrapper { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* Fixed-width tables: column widths set by <colgroup>/<col>, never reflow on cell content changes */
.fixed-table { table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; }
.fixed-table input,
.fixed-table select,
.fixed-table textarea { width: 100%; box-sizing: border-box; min-width: 0; }

