/* Contralio Board: components on top of the shared Contralio styles (style.css). */

/* ---------- Brand and top bar ---------- */
.navbar a.brand { margin: 0; color: #fff; text-decoration: none; }
.brand-product { font-weight: 500; color: #94a3b8; margin-inline-start: 2px; }
.auth-logo .brand-product { color: inherit; opacity: .7; }
.topbar-company { color: #94a3b8; font-size: 13px; font-weight: 500; }
.side-section { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }

/* ---------- Text helpers ---------- */
.muted { color: #6b7280; }
.small { font-size: 12px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.num { text-align: end; }
th.num { text-align: end; }
.warn-text { color: #b45309; font-weight: 500; }
.strong-link { color: #111827; font-weight: 600; text-decoration: none; }
.strong-link:hover { color: #15803d; text-decoration: underline; }
.page a:not(.btn):not(.strong-link):not(.stat-card):not(.body-card):not(.back-link):not(.user-cell) { color: #15803d; }
.h1-sub { font-weight: 500; font-size: 18px; }
.prose { font-size: 14px; line-height: 1.6; color: #374151; max-width: 75ch; }
.req-star { color: #dc2626; }
[dir="rtl"] .side-section { letter-spacing: normal; }

/* ---------- Page headers ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 4px 0 0; }
.page-head-card { margin-bottom: 4px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; margin: 0; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: #111827; }
.card-title.spaced { margin-top: 24px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .empty-state { padding: 32px 20px; }
.empty-card { text-align: center; padding: 48px 24px; }
.empty-card h1 { margin-bottom: 8px; }
.empty-state a { color: #15803d; }

/* ---------- Badges and pills ---------- */
.badge-muted { background: #e5e7eb; color: #4b5563; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-warn { background: #fef3c7; color: #92400e; }
.type-badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; background: #f1f5f9; color: #334155; white-space: nowrap; }
.type-board { background: #14532d; color: #fff; }
.type-executive { background: #e0e7ff; color: #3730a3; }
.type-audit { background: #e0f2fe; color: #075985; }
.type-risk { background: #fee2e2; color: #991b1b; }
.type-finance { background: #dcfce7; color: #166534; }
.type-remuneration { background: #fef3c7; color: #92400e; }
.type-custom { background: #f1f5f9; color: #334155; }
.role-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #ecfdf3; color: #166534; white-space: nowrap; }
.role-chairman { background: #166534; color: #fff; }
.role-secretary { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
.body-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.page-head-card .body-tags { margin: 0 0 8px; }

/* ---------- Dashboard ---------- */
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
a.stat-card { text-decoration: none; color: inherit; display: block; }
.stat-card-warning .stat-value { color: #b91c1c; }
.body-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.body-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid #eef0f4; text-decoration: none; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.body-card:hover { box-shadow: 0 8px 20px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.body-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.body-card-name { font-size: 17px; font-weight: 700; color: #111827; margin-top: 6px; }
.body-card-sub { font-size: 12px; color: #6b7280; }
.body-card-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.body-card-facts dt { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.body-card-facts dd { margin: 2px 0 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.body-card-term { font-size: 12px; color: #92400e; margin-top: 4px; }
.dash-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dash-two > *, .split > *, .body-cards > * { min-width: 0; }
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.plain-list li:last-child { border-bottom: none; }
[dir="rtl"] .body-card-facts dt { letter-spacing: normal; }

/* ---------- Lists and tables ---------- */
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.pill-tabs a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: #4b5563 !important; text-decoration: none; border: 1px solid #e5e7eb; background: #fff; }
.pill-tabs a.active { background: #166534; color: #fff !important; border-color: #166534; }
.filter-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.filter-bar .pill-tabs { margin: 0; }
.filter-search { max-width: 320px; margin: 0 0 14px; }
.card-flush table th:first-child, .card-flush table td:first-child { padding-inline-start: 20px; }
.card-flush table th:last-child, .card-flush table td:last-child { padding-inline-end: 20px; }
td { vertical-align: middle; }
.row-muted td { color: #9ca3af; }
.row-actions { white-space: nowrap; text-align: end; }
.row-actions a, .row-actions form { margin-inline-start: 12px; font-size: 13px; font-weight: 500; }
.link-danger, .link-danger:hover { background: none; border: 0; padding: 0; color: #dc2626; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; }
.body-name { display: flex; align-items: flex-start; gap: 8px; }
.body-name.depth-1 { padding-inline-start: 22px; }
.body-name.depth-2 { padding-inline-start: 44px; }
.body-name.depth-3 { padding-inline-start: 66px; }
.tree-mark { color: #9ca3af; font-size: 16px; line-height: 1.2; }
[dir="rtl"] .tree-mark { transform: scaleX(-1); }
.user-cell { text-decoration: none; }
.detail-tabs-top { margin: 22px 0 16px; }
.tab-n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11px; line-height: 18px; text-align: center; margin-inline-start: 4px; }
.detail-tab-btn.active .tab-n { background: #dcfce7; color: #166534; }

/* ---------- Forms ---------- */
.form-card { max-width: 860px; }
.form-narrow { max-width: 480px; }
.form-section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.form-section:first-of-type { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.field { margin-bottom: 14px; }
.field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field-check input { width: 16px; height: 16px; margin: 0; }
.field-help { font-size: 12px; color: #6b7280; margin-top: 4px; }
.field-error input, .field-error select, .field-error textarea { border-color: #f87171; }
.field-error-text { color: #b91c1c; font-size: 12px; margin-top: 4px; }
.field input[type=file] { font-size: 13px; margin-top: 4px; }
input[type=tel] { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.btn-danger-solid { background: #dc2626; }
.btn-danger-solid:hover { background: #b91c1c; }
.danger-zone { margin-top: 4px; font-size: 13px; color: #6b7280; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.split .form-card { max-width: none; }
.link-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.link-box input { font-size: 12px; }
.set-password { margin-top: 14px; font-size: 14px; }
.set-password summary { cursor: pointer; color: #15803d; font-weight: 500; margin-bottom: 10px; }
.audit-filters .audit-filter-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.audit-filters .form-actions { margin-top: 10px; }
.audit-cat-users { background: #ede9fe; color: #5b21b6; }
.audit-cat-governance { background: #e7f6ec; color: #1f7a3f; }

/* ---------- History (a body's History tab) ---------- */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.history-when { color: #6b7280; font-size: 13px; }
.history-failed .history-what { color: #b91c1c; }

/* ---------- Phones ---------- */
@media (max-width: 900px) {
    .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .dash-two, .split { grid-template-columns: minmax(0, 1fr); }
    .audit-filters .audit-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .topbar-company { display: none; }
    .profile-panel { position: fixed; inset-inline: 10px; top: 64px; width: auto; max-height: calc(100vh - 150px); overflow-y: auto; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .history-item { grid-template-columns: 1fr; gap: 2px; }
    .head-actions { width: 100%; }
    .filter-search { max-width: none; }
    .card-flush table th:first-child, .card-flush table td:first-child { padding-inline-start: 14px; }
}

/* ---------- Phase 1.1: roles, composition, terms, charters, profiles ---------- */
.role-vice_chairman { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.role-observer { background: #f1f5f9; color: #475569; border: 1px dashed #cbd5e1; }
.badge-fin { background: #fef3c7; color: #92400e; font-size: 11px; }
.composition { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 18px 0 0; padding: 12px 14px; background: #f8fafc; border: 1px solid #eef0f4; border-radius: 10px; }
.composition-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin-inline-end: 4px; }
.comp-item { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.comp-ok { background: #f0fdf4; color: #166534; }
.comp-info { background: #f1f5f9; color: #64748b; }
.comp-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.issue-list { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; color: #92400e; }
.issue-list li { padding: 1px 0; border: 0; font-size: 13px; }
.check-row { display: flex; flex-wrap: wrap; gap: 0 28px; }
.field-disabled { opacity: .5; }
.form-section-help { margin: -4px 0 12px; }
.renew-list { list-style: none; margin: 0; padding: 0; }
.renew-list li { border-bottom: 1px solid #f1f5f9; }
.renew-list label { display: flex; align-items: center; gap: 12px; padding: 10px 4px; font-weight: 400; cursor: pointer; margin: 0; }
.renew-list input { width: 18px; height: 18px; margin: 0; accent-color: #16a34a; }
.charter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.me-head .head-actions { margin-inline-start: auto; }
.profile-avatar-xxl { width: 104px; height: 104px; font-size: 34px; }
.person-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.person-main { flex: 1; min-width: 220px; }
.person-main h1 { margin-bottom: 2px; }
.person-title { margin: 0 0 10px; color: #4b5563; font-size: 15px; }
.person-contact { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; font-size: 14px; }
.person-contact dt { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.person-contact dd { margin: 2px 0 0; }
.person-head .head-actions { align-self: flex-start; }
.photo-row { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.photo-input { flex: 1; min-width: 0; }
a.user-cell { color: inherit; }
a.user-cell:hover .strong-link { color: #15803d; text-decoration: underline; }
[dir="rtl"] .composition-title, [dir="rtl"] .person-contact dt { letter-spacing: normal; }
@media (max-width: 720px) {
    .person-head { flex-direction: column; align-items: flex-start; }
    .me-head { flex-wrap: wrap; }
}
