/* Nilsaro Python Template — minimal foundation styles */

:root {
    /* --primary-color and --accent-color are overridden per-request in
       base.html from the organisation's branding, so these two are the
       platform's own colours: what an unbranded organisation, and the portal
       itself, look like. Both come off the logo. The primary is the brand blue
       seated dark enough to carry white button text against --bg-color, which
       the logo's own #2eb6fe cannot do at 2:1. */
    --primary-color: #006593;
    --accent-color: #162c55;
    --brand-navy: #162c55;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --info-bg: #eff6ff;
    --info-text: #1e40af;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.5;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

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

.logo { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--primary-color); text-decoration: none; }

/* The logo is drawn for the navy, so on this near-white header it brings the
   navy with it as a tile — the PNG is transparent outside the letterform and
   this background shows through. Mirrors .nilsaro-mark in modernist.css; the
   two design systems never share a stylesheet, so the rule is stated twice. */
.nilsaro-mark {
    width: 26px; height: 26px; flex: none;
    background: var(--brand-navy);
    padding: 5px 7px; object-fit: contain; display: block;
}

.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.main-nav a { color: var(--text-color); text-decoration: none; }
.main-nav a:hover { color: var(--primary-color); }

.nav-divider { color: var(--border-color); }

.context-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.context-pill--tenant { background: var(--info-bg); color: var(--info-text); }
.context-pill--support { background: var(--warning-bg); color: var(--warning-text); }
.context-pill--user { background: #f3f4f6; color: #4b5563; }

.context-banner {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.context-banner--platform { background: #eef2ff; color: #3730a3; }
.context-banner--tenant_admin { background: var(--info-bg); color: var(--info-text); }
.context-banner--support { background: var(--warning-bg); color: var(--warning-text); }

.main-content { padding: 2rem 0; min-height: 60vh; }

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card h2 { margin-top: 0; font-size: 1.1rem; }

.auth-card { max-width: 400px; margin: 2rem auto; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: #e5e7eb; color: var(--text-color); }
.btn-danger { background: #dc2626; color: white; }

.form-input, input, select, textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.filter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filter-form label { font-size: 0.875rem; }

.messages { list-style: none; padding: 0; }
.message { padding: 0.75rem; border-radius: 4px; margin-bottom: 0.5rem; }
.message-error { background: #fef2f2; color: #991b1b; }
.message-success { background: #f0fdf4; color: #166534; }
.message-warning { background: #fffbeb; color: #92400e; }
.message-info { background: #eff6ff; color: #1e40af; }

.sub-nav { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.sub-nav a { color: var(--text-color); text-decoration: none; padding-bottom: 0.15rem; border-bottom: 2px solid transparent; }
.sub-nav a:hover { color: var(--primary-color); }
.sub-nav a.nav-link-active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
th { font-size: 0.85rem; color: #4b5563; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.stat-card {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
}

.stat-card strong { display: block; font-size: 1.4rem; line-height: 1.2; }
.stat-card span { font-size: 0.8rem; color: #6b7280; }

.shortcut-list { list-style: none; padding: 0; margin: 0; }
.shortcut-list li { margin-bottom: 0.35rem; }

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge--neutral { background: #f3f4f6; color: #374151; }
.status-badge--success { background: var(--success-bg); color: var(--success-text); }
.status-badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.status-badge--danger { background: var(--danger-bg); color: var(--danger-text); }
.status-badge--info { background: var(--info-bg); color: var(--info-text); }

.admin-help {
    background: #f9fafb;
    border-left: 3px solid var(--primary-color);
    padding: 0.65rem 0.85rem;
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.empty-state { color: #6b7280; padding: 1rem 0; }
.empty-state p { margin: 0 0 0.5rem; }

.detail-list { margin: 0; }
.detail-list dt { font-weight: 600; margin-top: 0.75rem; }
.detail-list dt:first-child { margin-top: 0; }
.detail-list dd { margin: 0.15rem 0 0; }

.danger-zone {
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.qr-code { display: block; margin: 1rem auto; }

.text-muted { color: #6b7280; font-size: 0.875rem; }
.notice { background: #fffbeb; padding: 0.5rem; border-radius: 4px; }

.foundation-list { list-style: disc; padding-left: 1.5rem; }

.notification-list { list-style: none; padding: 0; }
.notification-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-color); }
.notification-unread { font-weight: 600; }

.token-secret {
    word-break: break-all;
    background: #f3f4f6;
    padding: 0.75rem;
    border-radius: 4px;
}

.launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.launcher-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.launcher-tile:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.launcher-tile__label { font-size: 1.1rem; font-weight: 600; }
.launcher-tile__product { font-size: 0.8rem; color: #6b7280; }
.launcher-tile__description { font-size: 0.875rem; color: #4b5563; }
.launcher-tile__external { font-size: 0.75rem; color: #6b7280; }

.launcher-tile--disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: default;
}
.launcher-tile--disabled:hover {
    border-color: var(--border-color);
    box-shadow: none;
}
.launcher-tile__status {
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    background: #e5e7eb;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}
