/* =============================================
   Novicore BC — User Space CSS (SaaS Modern)
   ============================================= */

/* ---- Variables ---- */
:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-light: #eff6ff;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0891b2;
    --info-bg: #ecfeff;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

/* ---- Reset for user pages ---- */
.app-body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--surface-2);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* =============================================
   AUTH LAYOUT (login / register pages)
   ============================================= */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 24px 16px;
}

.auth-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 36px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    letter-spacing: -1px;
}

.auth-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-logo-text span {
    color: var(--brand);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 28px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* =============================================
   APP TOPBAR
   ============================================= */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    box-shadow: var(--shadow);
}

.app-topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.app-topbar-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    letter-spacing: -0.5px;
}

.app-topbar-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.app-topbar-logo-text span {
    color: var(--brand);
}

.app-topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    margin-left: 12px;
    list-style: none;
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.app-topbar-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.app-topbar-nav a:hover,
.app-topbar-nav a.active {
    background: var(--brand-light);
    color: var(--brand);
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Notification badge */
.app-notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s;
    font-size: 17px;
}

.app-notif-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.app-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* Push notification toggle */
.app-push-toggle {
    display: flex;
    align-items: center;
}

.app-push-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
    padding: 0;
}

.app-push-btn:hover {
    background: var(--surface-2);
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.app-push-btn.push-active {
    background: var(--brand-light);
    color: var(--brand);
    border-color: var(--brand);
}

.app-push-btn.push-active .push-slash {
    display: none;
}

.app-push-btn:not(.push-active) .push-slash {
    display: inline;
    stroke: var(--text-muted);
}

.app-push-btn:disabled {
    opacity: .5;
    cursor: wait;
}

.app-push-label {
    display: none;
}

@media (min-width: 768px) {
    .app-push-btn {
        width: auto;
        border-radius: var(--radius-sm);
        padding: 6px 12px;
        font-size: 13px;
    }

    .app-push-label {
        display: inline;
    }
}

/* User dropdown */
.app-user-dropdown {
    position: relative;
}

.app-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}

.app-user-btn:hover {
    background: var(--surface-2);
}

.app-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.app-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 6px;
}

.app-user-dropdown:focus-within .app-user-menu,
.app-user-dropdown.open .app-user-menu {
    display: block;
}

.app-user-menu-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.app-user-menu-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.app-user-menu-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.app-user-menu a,
.app-user-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
}

.app-user-menu a:hover,
.app-user-menu button:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.app-user-menu .logout-item {
    color: var(--danger);
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 8px;
}

.app-user-menu .logout-item:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* =============================================
   APP PAGE STRUCTURE
   ============================================= */

.app-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
}

.app-page-header {
    margin-bottom: 24px;
}

.app-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}

.app-page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* =============================================
   STAT CARDS (dashboard)
   ============================================= */

.app-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.app-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.app-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
}

.app-stat-card.brand .app-stat-value { color: var(--brand); }
.app-stat-card.success .app-stat-value { color: var(--success); }
.app-stat-card.warning .app-stat-value { color: var(--warning); }

/* =============================================
   CARDS
   ============================================= */

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.app-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.app-card-body {
    padding: 20px;
}

/* =============================================
   TABLES
   ============================================= */

.app-table-wrap {
    overflow-x: auto;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.app-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.app-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.app-table tbody tr:hover {
    background: var(--surface-2);
}

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

/* =============================================
   BADGES
   ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-gray    { background: #f1f5f9; color: #64748b; }
.badge-brand   { background: var(--brand-light); color: var(--brand); }

/* =============================================
   FORMS (user space)
   ============================================= */

.app-form-group {
    margin-bottom: 18px;
}

.app-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.app-form-group input[type="text"],
.app-form-group input[type="email"],
.app-form-group input[type="password"],
.app-form-group input[type="tel"],
.app-form-group select,
.app-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.5;
}

.app-form-group input:focus,
.app-form-group select:focus,
.app-form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.app-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.app-form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.app-form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, opacity .15s;
    line-height: 1;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--brand-dark);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-2);
}

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

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

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245,158,11,.3);
}

/* Quota upgrade block (alert index) */
.quota-upgrade-block {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 14px;
}

.quota-badge {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ---- Plan badge (topbar) ---- */
.app-plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: opacity .15s;
    white-space: nowrap;
}
.app-plan-badge:hover { opacity: .75; }
.app-plan-badge--essentiel {
    background: var(--brand-light);
    color: var(--brand);
    border-color: #bfdbfe;
}
.app-plan-badge--pro {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* ---- Contact page ---- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 24px;
    align-items: start;
}
.contact-info-title,
.contact-form-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text-primary);
}
.contact-info-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.contact-plan-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.contact-plan-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.contact-plan-item p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 2px;
}
.contact-info-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.contact-info-footer p { margin: 4px 0; font-size: 14px; }
@media (max-width: 768px) {
    .contact-layout { grid-template-columns: 1fr; }
}

.btn-full {
    width: 100%;
}

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

.app-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.app-filters .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.app-filters input,
.app-filters select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-2);
}

.app-filters input:focus,
.app-filters select:focus {
    outline: none;
    border-color: var(--brand);
}

/* Tom Select integration dans les filtres */
.app-filters .ts-wrapper {
    width: 100%;
}

.app-filters .ts-control {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-2);
    min-height: 34px;
    box-shadow: none;
}

.app-filters .ts-control:focus,
.app-filters .ts-wrapper.focus .ts-control {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.app-filters .ts-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 13px;
}

.app-filters .ts-dropdown .option.selected,
.app-filters .ts-dropdown .option:hover {
    background: var(--brand-light);
    color: var(--brand);
}

/* Grille de filtres multi-ligne */
.app-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 16px;
    align-items: end;
}

.app-filters-grid .filter-group--wide {
    grid-column: span 2;
}

.app-filters-grid .filter-group--actions {
    grid-column: span 1;
    justify-self: end;
}

@media (max-width: 900px) {
    .app-filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-filters-grid .filter-group--wide {
        grid-column: span 2;
    }

    .app-filters-grid .filter-group--actions {
        grid-column: span 2;
    }
}

@media (max-width: 540px) {
    .app-filters-grid {
        grid-template-columns: 1fr;
    }

    .app-filters-grid .filter-group--wide,
    .app-filters-grid .filter-group--actions {
        grid-column: span 1;
    }
}

/* =============================================
   PAGINATION
   ============================================= */

.app-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    justify-content: center;
}

.app-pagination a,
.app-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--surface);
    transition: background .15s, color .15s;
}

.app-pagination a:hover {
    background: var(--brand-light);
    color: var(--brand);
    border-color: var(--brand);
}

.app-pagination .current {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.app-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* =============================================
   NOTICE CARDS (list)
   ============================================= */

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: box-shadow .15s, border-color .15s;
    text-decoration: none;
    color: inherit;
}

.notice-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #c7d2fe;
}

.notice-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.notice-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
}

.notice-card-title:hover {
    color: var(--brand);
}

.notice-card-ref {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.notice-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.notice-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================
   NOTICE DETAIL
   ============================================= */

.notice-detail-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.notice-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.notice-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.notice-detail-meta strong {
    color: var(--text-primary);
}

/* =============================================
   ALERT FORM
   ============================================= */

.keywords-help {
    background: var(--brand-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--brand-dark);
    margin-top: 6px;
}

/* =============================================
   NOTIFICATION ITEMS
   ============================================= */

.notif-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--surface-2);
}

.notif-item.unread {
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
    padding-left: 17px;
}

.notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 6px;
}

.notif-item.read .notif-dot {
    background: var(--border);
}

.notif-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.notif-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* =============================================
   FLASH MESSAGES
   ============================================= */

.app-flash {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-flash.success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.app-flash.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #fecaca; }
.app-flash.info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #a5f3fc; }

/* =============================================
   EMPTY STATE
   ============================================= */

.app-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.app-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
}

.app-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.app-empty-text {
    font-size: 14px;
    margin: 0 0 20px;
}

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

@media (max-width: 768px) {
    .app-topbar {
        padding: 0 14px;
    }

    .app-topbar-nav {
        display: none;
    }

    .app-content {
        padding: 16px 14px;
    }

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

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

    .auth-card {
        padding: 28px 20px 24px;
    }

    .notice-card-top {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .app-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0 0 24px;
    max-width: 420px;
    margin-inline: auto;
    margin-bottom: 24px;
}

/* ================================================================
   ALERT CARDS
   ================================================================ */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    transition: opacity 0.2s;
}

.alert-card--inactive {
    opacity: 0.6;
}

.alert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.alert-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alert-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.alert-channels {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ================================================================
   ALERT FORM
   ================================================================ */
.form-card {
    max-width: 780px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.form-select-multi {
    min-height: 160px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 2px 0 6px;
}

.channels-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.channels-checkboxes input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ================================================================
   NOTIFICATION LIST
   ================================================================ */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item--unread {
    border-left: 3px solid var(--primary);
}

.notification-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.notification-icon {
    position: relative;
    font-size: 1.2rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.unread-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 1px solid #fff;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-message {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.notification-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.notification-link:hover {
    text-decoration: underline;
}

.notification-date {
    margin-top: 2px;
}

@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .alert-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
