@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
    background: #f4f6f9;
    color: #1f2937;
    margin: 0;
}

/* Top nav */
.navbar {
    background: #101a33;
    color: #fff;
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar a {
    color: #cbd5e1;
    text-decoration: none;
    margin-inline-start: 20px;
    font-size: 14px;
    font-weight: 500;
}
.navbar a:hover { color: #fff; }
.navbar .brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.navbar .brand span { color: #4f9cff; }
.navbar form button {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.navbar form button:hover { color: #fff; }

/* Layout */
.page {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 24px;
}
.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; color: #374151; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: start;
    background: #f8fafc;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
table a { color: #2563eb; text-decoration: none; font-weight: 500; }
table a:hover { text-decoration: underline; }

/* Buttons */
button, .btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }
.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
a.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 16px;
}
a.back-link:hover { color: #374151; }

/* Flips the literal arrow character used in back-links (wrapped via a
   templates-wide find/replace: &larr; -> <span class="back-arrow">&larr;</span>)
   so "back" visually points toward the reading-start direction in RTL. */
.back-arrow {
    display: inline-block;
}
[dir="rtl"] .back-arrow {
    display: inline-block;
    transform: scaleX(-1);
}

/* Forms */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-top: 4px;
}
label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 4px;
}
form p { margin-bottom: 16px; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-internalreview { background: #f1f5f9; color: #475569; }
.badge-submitted { background: #f1f5f9; color: #475569; }
.badge-approvalprocess { background: #fef3c7; color: #92400e; }
.badge-signatureprocess { background: #dbeafe; color: #1e40af; }
.badge-active { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-awaitingsignature { background: #fef3c7; color: #92400e; }
.badge-expired { background: #fee2e2; color: #b91c1c; }
.badge-closed { background: #e5e7eb; color: #4b5563; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-waiting { background: #f1f5f9; color: #6b7280; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0 4px;
}
.meta-item .label { font-size: 11px; text-transform: uppercase; color: #9ca3af; font-weight: 600; letter-spacing: 0.4px; }
.meta-item .value { font-size: 14px; font-weight: 500; margin-top: 2px; }
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    position: relative;
}
.wizard-nav::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 3%;
    right: 3%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}
.wizard-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}
.wizard-step .circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 12px;
    font-weight: 700;
}
.wizard-step.active .circle { background: #2563eb; color: #fff; }
.wizard-step.done .circle { background: #16a34a; color: #fff; }
.wizard-step .label { font-size: 11px; font-weight: 600; color: #9ca3af; }
.wizard-step.active .label { color: #1f2937; }
.wizard-step.done .label { color: #16a34a; }

.detail-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 10px;
    font-size: 13px;
    display: none;
}
.detail-box .row { display: flex; justify-content: space-between; padding: 3px 0; }
.detail-box .row span:first-child { color: #6b7280; }
.status-bar {
    display: flex;
    margin: 20px 0 8px;
}
.status-bar .seg {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    background: #f1f5f9;
    border-inline-end: 2px solid #fff;
    position: relative;
}
.status-bar .seg:first-child { border-start-start-radius: 6px; border-end-start-radius: 6px; }
.status-bar .seg:last-child { border-start-end-radius: 6px; border-end-end-radius: 6px; border-inline-end: none; }
.status-bar .seg.done { background: #ecfdf5; color: #047857; }
.status-bar .seg.current { background: #1e40af; color: #fff; }
.status-alt-banner {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin: 20px 0 8px;
}
.status-alt-banner.rejected { background: #fee2e2; color: #b91c1c; }
.status-alt-banner.expired { background: #fee2e2; color: #b91c1c; }
.status-alt-banner.closed { background: #e5e7eb; color: #4b5563; }
.detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.detail-main {
    flex: 1;
    min-width: 0;
}
.detail-sidebar {
    width: 220px;
    flex-shrink: 0;
}
.detail-sidebar .card { padding: 18px; }
.detail-sidebar h2 {
    margin: 0 0 14px;
    font-size: 14px;
}
.detail-sidebar .btn, .detail-sidebar .btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.detail-sidebar .btn:last-child, .detail-sidebar .btn-secondary:last-child {
    margin-bottom: 0;
}
@media (max-width: 720px) {
    .detail-layout { flex-direction: column; }
    .detail-sidebar { width: 100%; }
}
.preview-overlay {
    position: fixed;
    top: 0; inset-inline-end: 0; bottom: 0;
    width: 45%;
    min-width: 360px;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0,0,0,0.12);
    z-index: 100;
    display: none;
    flex-direction: column;
}
[dir="rtl"] .preview-overlay {
    box-shadow: 4px 0 16px rgba(0,0,0,0.12);
}
.preview-overlay.open { display: flex; }
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.preview-header h3 { margin: 0; font-size: 14px; }
.preview-header button {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.preview-body { flex: 1; min-height: 0; overflow: auto; }  /* min-height:0 lets it scroll instead of growing past the screen */
.preview-body iframe { width: 100%; height: 100%; border: none; }
.preview-unsupported {
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
}
.preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 99;
    display: none;
}
.preview-backdrop.open { display: block; }
.detail-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}
.detail-tab-btn {
    background: none;
    border: none;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}
.detail-tab-btn:hover { color: #1f2937; background: none; }
.detail-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border-inline-start: 4px solid #d8dce6;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.stat-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #7a7f8d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

/* Same blue scale as the status chart: lighter = earlier stage, darker = further along */
.stat-card-total     { border-inline-start-color: #475569; }
.stat-card-review    { border-inline-start-color: #86b6ef; }
.stat-card-approval  { border-inline-start-color: #5598e7; }
.stat-card-signature { border-inline-start-color: #2a78d6; }
.stat-card-active    { border-inline-start-color: #0d366b; }
.stat-card-warning   { border-inline-start-color: #e53e3e; background: #fff5f5; }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    max-width: 500px;
}

.chart-card h3 {
    margin: 0 0 14px 0;
    font-size: 15px;
    color: #1a1a2e;
}
.chart-card-wide {
    max-width: none;
    margin-top: 16px;
}
.expiry-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.expiry-table th {
    text-align: start;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7a7f8d;
    padding: 8px 10px;
    border-bottom: 2px solid #eef0f4;
}

.expiry-table td {
    padding: 10px;
    border-bottom: 1px solid #eef0f4;
    font-size: 14px;
}

.expiry-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #edf2f7;
    color: #4a5568;
}

.expiry-pill-urgent {
    background: #fff5f5;
    color: #e53e3e;
}
.approval-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 10px;
    padding: 14px 20px;
    margin-top: 18px;
    font-size: 14px;
    color: #2c5282;
}

.approval-banner strong {
    font-size: 18px;
    margin-inline-end: 4px;
}
.approvals-table {
    width: 100%;
    border-collapse: collapse;
}

.approvals-table th {
    text-align: start;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7a7f8d;
    padding: 10px 12px;
    border-bottom: 2px solid #eef0f4;
}

.approvals-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
}

.approvals-table a {
    color: #1a1a2e;
    font-weight: 600;
    text-decoration: none;
}

.approvals-table a:hover {
    text-decoration: underline;
}

.stage-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 12px;
    font-weight: 600;
}

.approval-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.approval-comment-input {
    width: 200px;
    padding: 7px 10px;
    border: 1px solid #d8dce6;
    border-radius: 6px;
    font-size: 13px;
}

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

.approval-list {
    display: flex;
    flex-direction: column;
}

.approval-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 20px 4px;
    border-bottom: 1px solid #eef0f4;
}

.approval-delegate-row {
    grid-column: 1 / -1;
}

.approval-delegate-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 14px;
    margin-top: 4px;
    border-top: 1px dashed #e5e7eb;
}

.delegate-department-select,
.delegate-user-select {
    width: 180px;
    padding: 7px 10px;
    border: 1px solid #d8dce6;
    border-radius: 6px;
    font-size: 13px;
}

.approval-row:last-child { border-bottom: none; }

.approval-row-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.approval-row-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.approval-row-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 720px) {
    .approval-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .approval-row-controls,
    .approval-form {
        width: 100%;
    }
}

.empty-state {
    color: #7a7f8d;
    padding: 20px 0;
    text-align: center;
}
.alert-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
}
.vault-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* RTL script polish: letter-spacing is a Latin-typography convention that
   visually breaks Arabic letterforms (it forces gaps between connected
   letters), and uppercase transforms are meaningless for Arabic. Both are
   harmless to reset globally under [dir="rtl"]. */
[dir="rtl"] th,
[dir="rtl"] .expiry-table th,
[dir="rtl"] .approvals-table th,
[dir="rtl"] .stat-label,
[dir="rtl"] .meta-item .label,
[dir="rtl"] .navbar .brand {
    letter-spacing: normal;
}
/* ---------- App shell: top bar + left sidebar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 60px;
    padding: 0 24px;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.navbar a.topbar-new {
    margin: 0;
    background: #2563eb;
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
}
.navbar a.topbar-new:hover { background: #1d4ed8; color: #fff; }
.topbar-select {
    width: auto;
    min-width: 0;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Profile button + dropdown */
.profile-menu { position: relative; }
.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #e2e8f0;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
.profile-btn:hover { background: rgba(255,255,255,0.16); }
[dir="rtl"] .profile-btn { padding: 4px 4px 4px 10px; }
.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4f9cff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.profile-panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: #fff;
    color: #1f2937;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    border: 1px solid #e5e7eb;
    padding: 14px 16px;
    z-index: 60;
}
.profile-panel-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.profile-panel-name { font-weight: 600; font-size: 14px; }
.profile-panel-sub { color: #6b7280; font-size: 12px; word-break: break-all; }
.profile-panel-list { margin: 10px 0 0; font-size: 13px; }
.profile-panel-list dt { color: #9ca3af; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 6px; }
.profile-panel-list dd { margin: 2px 0 0; font-weight: 500; }

/* Sidebar */
.app-shell { display: flex; align-items: flex-start; }
.sidebar {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-inline-end: 1px solid #e5e7eb;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    text-align: start;
    font-family: inherit;
    cursor: pointer;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-link:hover { background: #f1f5f9; color: #111827; }
.side-link.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.side-logout { margin-top: auto; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.side-logout .side-link { color: #6b7280; }
.side-logout .side-link:hover { background: #fef2f2; color: #dc2626; }
.app-shell > .page { flex: 1; min-width: 0; }

@media (max-width: 720px) {
    .navbar { padding: 0 12px; }
    .profile-name { display: none; }
    .app-shell { flex-direction: column; align-items: stretch; }
    .sidebar {
        position: static;
        height: auto;
        width: 100%;
        flex-direction: row;
        border-inline-end: none;
        border-bottom: 1px solid #e5e7eb;
        overflow-x: auto;
        padding: 8px;
    }
    .side-link { width: auto; white-space: nowrap; }
    .side-logout { margin-top: 0; margin-inline-start: auto; border-top: none; padding-top: 0; }
}
.profile-panel-logout { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #f1f5f9; }
/* ".navbar" prefix: beats the older ".navbar form button" rule, which made this grey. */
.navbar .profile-panel-logout button {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    background: #fff; border: 1px solid #fca5a5; color: #dc2626;
    padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.navbar .profile-panel-logout button:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ---------- Reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-grid .card { margin-bottom: 0; }
.report-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.report-card:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(37, 99, 235, .12); }
.report-card-title { font-size: 16px; font-weight: 700; color: #1f2937; }
.report-card-desc { font-size: 13px; color: #6b7280; margin: 6px 0 14px; flex: 1; }
.report-card-open { font-size: 13px; font-weight: 600; color: #2563eb; }
.report-export { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; text-decoration: none; }
.report-export-xlsx { background: #047857; }
.report-export-xlsx:hover { background: #065f46; }
.report-export-pdf { background: #b91c1c; }
.report-export-pdf:hover { background: #991b1b; }
.report-filters { margin-top: 18px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.report-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.report-filter { display: flex; flex-direction: column; gap: 4px; font-weight: normal; margin: 0; }
.report-filter > span { font-size: 12px; font-weight: 600; color: #6b7280; }
.report-columns { margin-top: 12px; font-size: 13px; }
.report-columns summary { cursor: pointer; color: #2563eb; font-weight: 600; }
.report-columns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin-top: 8px; }
.report-columns-grid label { display: flex; align-items: center; gap: 6px; font-weight: normal; margin: 0; }
.report-table td.num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-total td { font-weight: 700; background: #f1f5f9; }

/* ---------- Agreement source (wizard) and generate box (request page) ---------- */
.doc-source { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.doc-source-option, .template-choice {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0;
    border: 1px solid #e5e7eb; border-radius: 8px; cursor: pointer; font-weight: normal;
}
.doc-source-option input, .template-choice input { width: auto; margin-top: 3px; }
.doc-source-option:has(input:checked), .template-choice:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.doc-source-hint { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.doc-source-body { margin: 0 0 6px 28px; display: flex; flex-direction: column; gap: 6px; }
/* Request page sidebar: stacked, equal-width, same-blue buttons */
.detail-sidebar .card { margin-bottom: 16px; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-list form { margin: 0; }
.action-list .btn, .action-list button.btn { width: 100%; margin: 0; text-align: center; }
.generate-box { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid #f1f5f9; }
.generate-box label { font-size: 12px; font-weight: 600; color: #6b7280; margin: 0; }
.generate-box select { width: 100%; margin: 0; }

.blank-fields-warning { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.blank-fields-warning ul { margin: 6px 0; padding-inline-start: 20px; }
.blank-fields-warning li span { color: #b45309; font-size: 12px; }

.source-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.source-template { background: #ecfdf5; color: #047857; }
.source-edited { background: #fffbeb; color: #b45309; }
.source-uploaded { background: #eff6ff; color: #1d4ed8; }

/* "Your decision" block on the request page */
.my-decision { background: #fff; border: 1px solid #dbeafe; border-inline-start: 3px solid #2563eb; border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.my-decision-title { font-weight: 700; font-size: 14px; color: #111827; }
.my-decision-stage { font-size: 12px; color: #6b7280; margin: 2px 0 10px; }
.my-decision textarea { width: 100%; font-family: inherit; font-size: 13px; resize: vertical; }
.action-list .btn.btn-reject { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.action-list .btn.btn-reject:hover { background: #fef2f2; color: #b91c1c; }
.delegate-box { margin-top: 10px; padding-top: 10px; border-top: 1px solid #bfdbfe; }
.delegate-box label { font-size: 12px; font-weight: 600; color: #1e3a8a; margin: 0; }

/* Word preview inside the agreement preview window */
.preview-body .docx-preview-host { min-height: 100%; background: #e5e7eb; }
.preview-body .docx-wrapper { background: #e5e7eb; padding: 16px; }
.preview-body .docx-wrapper > section.docx { box-shadow: 0 2px 10px rgba(0,0,0,.15); margin-bottom: 16px; }
.docx-preview-loading { padding: 40px; text-align: center; color: #6b7280; }

/* Small inline forms under an action button (e.g. Force Active date) */
.inline-box { display: flex; flex-direction: column; gap: 6px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; }
.inline-box label { font-size: 12px; font-weight: 600; color: #6b7280; margin: 0; }
.inline-box input[type="date"] { width: 100%; margin: 0; }
.inline-box-hint { font-size: 11px; color: #9ca3af; }

/* Light header band across the top of a card (request page) */
.card-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #f8fafc; border-bottom: 1px solid #e5e7eb;
    margin: -24px -28px 20px; padding: 10px 28px;
    border-radius: 10px 10px 0 0;
}
.request-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.request-ids > span:not(.request-ids-sep) {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6b7280;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 3px 8px;
}
.request-ids strong { color: #111827; font-size: 13px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.request-ids-sep { display: none; }
.card-bar-btn {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
    color: #374151; background: #fff; border: 1px solid #d1d5db;
}
.card-bar-btn:hover { background: #f9fafb; color: #111827; border-color: #9ca3af; }

/* Tabs in the same light band, blue underline on the selected tab */
.detail-tabs.card-bar-tabs { margin: 0 -28px; padding: 0 16px; gap: 0; border-bottom: 1px solid #e5e7eb; justify-content: flex-start; }
.card-bar-tabs .detail-tab-btn { color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 13px 16px; }
.card-bar-tabs .detail-tab-btn:hover { color: #111827; background: transparent; }
.card-bar-tabs .detail-tab-btn.active { color: #1d4ed8; border-bottom-color: #2563eb; background: #fff; }

/* Sidebar button hierarchy: one primary, the rest secondary; admin actions quiet */
.action-list .btn.btn-primary-action { background: #2563eb; color: #fff; border: 1px solid #2563eb; }
.action-list .btn.btn-primary-action:hover { background: #1d4ed8; }
.action-list .btn.btn-secondary { background: #fff; color: #1f2937; border: 1px solid #d1d5db; font-weight: 600; }
.action-list .btn.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; color: #111827; }
.action-list .btn-icon { display: flex; align-items: center; justify-content: center; gap: 8px; }
.action-list .btn-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.action-group-label {
    margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid #f1f5f9;
    font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #9ca3af;
}
.action-list .btn.btn-quiet { background: #f8fafc; color: #374151; border: 1px solid #e5e7eb; font-weight: 500; font-size: 13px; padding: 7px 12px; }
.action-list .btn.btn-quiet:hover { background: #f1f5f9; color: #111827; }
.action-list .btn.btn-quiet-danger { color: #b91c1c; }
.action-list .btn.btn-quiet-danger:hover { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Versions tab: file name + download button */
.file-name { word-break: break-all; font-weight: 500; }
/* Three-dot row menu */
.row-menu { position: relative; display: inline-block; }
.row-menu-btn { background: none; border: 1px solid transparent; color: #6b7280; padding: 4px 6px; border-radius: 6px; line-height: 0; cursor: pointer; }
.row-menu-btn:hover, .row-menu-btn[aria-expanded="true"] { background: #f1f5f9; color: #1f2937; border-color: #e5e7eb; }
.row-menu-panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .15);
    padding: 4px; text-align: start;
}
.row-menu-panel a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: #1f2937; text-decoration: none; font-size: 13px; white-space: nowrap; }
.row-menu-panel a:hover { background: #eff6ff; color: #1d4ed8; }

/* Request page sidebar: every action button looks the same (filled deep blue).
   Reject is the single exception so it can't be confused with Approve. */
.detail-sidebar .action-list .btn,
.detail-sidebar .action-list .btn.btn-primary-action,
.detail-sidebar .action-list .btn.btn-secondary,
.detail-sidebar .action-list .btn.btn-quiet,
.detail-sidebar .action-list .btn.btn-quiet-danger {
    background: #1e40af;
    color: #fff;
    border: 1px solid #1e40af;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
    transition: background-color .15s, box-shadow .15s;
}
.detail-sidebar .action-list .btn:hover,
.detail-sidebar .action-list .btn.btn-primary-action:hover,
.detail-sidebar .action-list .btn.btn-secondary:hover,
.detail-sidebar .action-list .btn.btn-quiet:hover,
.detail-sidebar .action-list .btn.btn-quiet-danger:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30, 58, 138, .25);
}
.detail-sidebar .action-list .btn:disabled { background: #93a5d8; border-color: #93a5d8; cursor: wait; }
.detail-sidebar .action-list .btn.btn-reject { background: #dc2626; color: #fff; border-color: #dc2626; }
.detail-sidebar .action-list .btn.btn-reject:hover { background: #b91c1c; border-color: #b91c1c; }

/* Request type badge under the request title */
.type-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.type-main-agreement { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.type-amendment { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.type-termination { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Vault > Users status */
.user-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.user-status-active { background: #ecfdf5; color: #047857; }
.user-status-inactive { background: #f1f5f9; color: #475569; }
.user-status-locked { background: #fffbeb; color: #b45309; }

/* Dashboard: Contracts by Status donut + legend */
.status-donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.status-donut-plot { position: relative; flex: 0 0 220px; width: 220px; }
.status-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.status-donut-total { font-size: 34px; font-weight: 800; color: #0f172a; line-height: 1; font-variant-numeric: tabular-nums; }
.status-donut-caption { font-size: 12px; color: #64748b; margin-top: 4px; }
.status-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 200px; min-width: 200px; }
.status-legend li {
    display: grid; grid-template-columns: 12px 1fr auto 44px; align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 6px; font-size: 13px; color: #1f2937; cursor: default;
}
.status-legend li:hover { background: #f8fafc; }
.status-legend li + li { border-top: 1px solid #f1f5f9; }
.status-legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.status-legend-count { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.status-legend-pct { color: #64748b; font-size: 12px; text-align: end; font-variant-numeric: tabular-nums; }
.status-legend li.is-empty { color: #9ca3af; }
.status-legend li.is-empty .status-legend-count { font-weight: 500; }
.status-legend li.is-empty .status-legend-swatch { opacity: .45; }

/* Vault > Users licence cards */
.license-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.license-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; background: #fff; }
.license-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.license-card-title { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #6b7280; }
.license-card-left { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; }
.license-card-figure { margin: 6px 0 8px; color: #6b7280; font-size: 13px; }
.license-card-figure strong { font-size: 24px; color: #0f172a; font-variant-numeric: tabular-nums; margin-inline-end: 4px; }
.license-bar { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.license-bar > span { display: block; height: 100%; border-radius: 999px; background: #2563eb; }
.license-card.state-nearly_full .license-bar > span { background: #f59e0b; }
.license-card.state-nearly_full .license-card-left { background: #fffbeb; color: #b45309; }
.license-card.state-full .license-bar > span, .license-card.state-over .license-bar > span { background: #dc2626; }
.license-card.state-full .license-card-left, .license-card.state-over .license-card-left { background: #fef2f2; color: #b91c1c; }
.license-card.state-none .license-card-left { background: #f1f5f9; color: #475569; }
.license-valid { font-size: 12px; color: #9ca3af; margin: 0 0 8px; }
.license-expiry { margin: 12px 0 4px; padding: 10px 14px; border-radius: 8px; font-size: 13px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.license-expiry.is-expired { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* Terminated contracts */
.status-alt-banner.terminated { background: #fef2f2; color: #991b1b; }
.status-alt-banner.terminated a { color: #991b1b; font-weight: 600; margin-inline-start: 8px; }
.badge-terminated { background: #fee2e2; color: #991b1b; }

/* Related Agreements tab: family timeline */
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-inline-start: 4px; border-radius: 999px; background: #e5e7eb; color: #374151; font-size: 11px; line-height: 18px; }
.family-intro { font-size: 13px; color: #6b7280; margin: 0 0 14px; }
.family-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.family-timeline::before { content: ''; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 7px; width: 2px; background: #e5e7eb; }
.family-item { position: relative; padding-inline-start: 30px; margin-bottom: 12px; }
.family-dot { position: absolute; inset-inline-start: 0; top: 16px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #93c5fd; box-sizing: border-box; }
.family-item.type-amendment .family-dot { border-color: #f59e0b; }
.family-item.type-termination .family-dot { border-color: #dc2626; }
.family-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; background: #fff; }
.family-item.is-current .family-card { border-color: #93c5fd; box-shadow: 0 0 0 3px #eff6ff; }
.family-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.family-num { font-weight: 700; color: #374151; font-variant-numeric: tabular-nums; }
.family-current { font-size: 11px; font-weight: 700; color: #1d4ed8; background: #eff6ff; border-radius: 999px; padding: 2px 8px; }
.family-status { margin-inline-start: auto; font-size: 12px; font-weight: 600; color: #374151; background: #f1f5f9; border-radius: 999px; padding: 2px 10px; }
.family-status.status-active { background: #dcfce7; color: #15803d; }
.family-status.status-terminated { background: #fee2e2; color: #991b1b; }
.family-title { display: block; margin-top: 6px; font-weight: 600; color: #111827; text-decoration: none; }
a.family-title:hover { color: #1d4ed8; text-decoration: underline; }
.family-meta { margin-top: 4px; font-size: 12px; color: #6b7280; display: flex; flex-wrap: wrap; gap: 4px; }
.family-ended { color: #b91c1c; font-weight: 600; }

/* Dashboard chart cards: header with title + quiet meta, fixed-height plot box */
.chart-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-card-head h3 { margin: 0; }
.chart-card-meta { font-size: 12px; color: #6b7280; }
.chart-box { position: relative; width: 100%; }

/* Approval Performance */
.perf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.perf-tile { border: 1px solid #eef2f7; border-radius: 10px; padding: 14px 16px; background: #fbfcfe; }
.perf-label { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #6b7280; }
.perf-value { font-size: 24px; font-weight: 800; color: #0f172a; margin-top: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.perf-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }
.perf-chart-title { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 6px; }


/* ---------------------------------------------------------- obligations */
.tab-count-alert { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ob-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #374151; }
.ob-summary-overdue { color: #b91c1c; }
.ob-muted { color: #6b7280; font-size: 13px; }
.ob-add-btn { padding: 7px 14px; font-size: 13px; background: #1e40af; }
.ob-add-btn:hover { background: #1e3a8a; }
.ob-note { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; }
.ob-table td { vertical-align: top; }
.ob-due { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ob-days { font-size: 12px; color: #6b7280; margin-top: 2px; }
.ob-overdue .ob-days { color: #b91c1c; font-weight: 600; }
.ob-duesoon .ob-days { color: #92400e; font-weight: 600; }
.ob-done td, .ob-cancelled td { color: #6b7280; }
.ob-cancelled .ob-title { text-decoration: line-through; }
.ob-title { font-weight: 600; color: #111827; }
.ob-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.ob-kind { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #e8f0fb; color: #1c5cab; }
.ob-direction, .ob-reminder { font-size: 11px; color: #6b7280; }
.ob-desc { font-size: 12px; color: #6b7280; margin-top: 6px; }
.ob-done-info { font-size: 12px; color: #15803d; margin-top: 6px; }
.ob-cancelled .ob-done-info { color: #6b7280; }
.ob-done-info a { font-weight: 500; }
.ob-amount { white-space: nowrap; text-align: end; font-variant-numeric: tabular-nums; }
.ob-state { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.ob-state-overdue { background: #fee2e2; color: #b91c1c; }
.ob-state-duesoon { background: #fef3c7; color: #92400e; }
.ob-state-upcoming { background: #e8f0fb; color: #1c5cab; }
.ob-state-done { background: #dcfce7; color: #15803d; }
.ob-state-cancelled { background: #e5e7eb; color: #4b5563; }
.ob-actions { white-space: nowrap; text-align: end; }
.ob-actions form { display: inline; margin: 0; }
.ob-btn { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; text-decoration: none; cursor: pointer; margin-inline-start: 4px; }
.ob-btn-done { background: #1e40af; color: #fff; border: none; }
.ob-btn-done:hover { background: #1e3a8a; }
.ob-btn-plain { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.ob-btn-plain:hover { background: #f9fafb; text-decoration: none; }
table a.ob-btn-plain { color: #374151; }
.ob-btn-remove { background: #fff; color: #dc2626; border: 1px solid #fca5a5; padding: 4px 9px; }
.ob-btn-remove:hover { background: #fef2f2; }
.ob-empty { text-align: center; padding: 28px 12px; border: 1px dashed #d1d5db; border-radius: 10px; color: #374151; }
.ob-empty p { margin: 4px 0; }
.ob-dialog { border: none; border-radius: 12px; padding: 22px 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.ob-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.ob-dialog h3 { margin: 0 0 4px; font-size: 17px; }
.ob-dialog-title { color: #6b7280; font-size: 13px; margin: 0 0 14px; }
.ob-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ob-form-card { max-width: 680px; }
.ob-form-contract { color: #6b7280; font-size: 13px; margin: 0 0 18px; }
.ob-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .ob-form-row { grid-template-columns: 1fr; } }
.ob-kind-picker { border: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.ob-kind-picker legend { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; padding: 0; }
.ob-kind-option { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 12px; cursor: pointer; margin: 0; }
.ob-kind-option:has(input:checked) { border-color: #1e40af; background: #eff4ff; color: #1e40af; }
.ob-optional { font-weight: 400; color: #9ca3af; }
.ob-help { display: block; font-size: 12px; color: #6b7280; margin-top: 4px; }
.ob-inline-input { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.ob-inline-input input { width: 90px; margin-top: 0; }
.ob-dimmed { opacity: .55; }
.ob-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ob-flash { background: #dcfce7; color: #15803d; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.ob-errors { background: #fee2e2; color: #b91c1c; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.perf-tile-alert { border-color: #fecaca; background: #fff5f5; }
.perf-tile-alert .perf-value { color: #b91c1c; }
.perf-value-text { font-size: 17px; }
.ob-report-link { text-decoration: none; color: #2563eb; font-weight: 500; }
.ob-dash-table { margin-top: 16px; }
.ob-dash-table .ob-title { font-weight: 600; margin-bottom: 3px; }
.ob-sub { font-size: 12px; color: #6b7280; }
.ob-due-cell { white-space: nowrap; }
.ob-more { margin: 10px 0 0; font-size: 13px; }
.ob-more a { color: #2563eb; text-decoration: none; }
.no-data { color: #6b7280; font-size: 13px; }

.side-badge { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.side-badge-alert { background: #dc2626; color: #fff; }
.ob-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 12px; border-bottom: 1px solid #e5e7eb; }
.ob-filter-tabs a { padding: 8px 12px; font-size: 14px; font-weight: 500; color: #6b7280; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ob-filter-tabs a:hover { color: #111827; }
.ob-filter-tabs a.active { color: #1e40af; border-bottom-color: #1e40af; font-weight: 600; }

/* Request page: Summary / Approval / Signature / Status History tabs inside the header card */
.detail-tabs-top { margin-top: 22px; }
.detail-tabs { flex-wrap: wrap; }  /* wrap rather than scroll if a bar ever runs out of room */
.detail-tab-btn { white-space: nowrap; flex-shrink: 0; }


/* ---------------------------------------------------------- comments */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cm-thread { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cm-item { display: flex; gap: 10px; align-items: flex-start; }
.cm-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #e8f0fb; color: #1c5cab; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cm-mine .cm-avatar { background: #1e40af; color: #fff; }
.cm-avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.cm-bubble { flex: 1; min-width: 0; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 14px; }
.cm-mine .cm-bubble { background: #f5f8ff; border-color: #dbe6fb; }
.cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #111827; }
.cm-role { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #e5e7eb; color: #374151; }
.cm-role-requestor { background: #e8f0fb; color: #1c5cab; }
.cm-role-approver { background: #fef3c7; color: #92400e; }
.cm-role-assignee { background: #dcfce7; color: #15803d; }
.cm-time { font-size: 12px; color: #9ca3af; }
.cm-delete { margin: 0 0 0 auto; }
.cm-delete button { background: none; border: none; padding: 0; color: #9ca3af; font-size: 12px; font-weight: 500; cursor: pointer; }
.cm-delete button:hover { color: #dc2626; background: none; text-decoration: underline; }
.cm-body { margin-top: 6px; font-size: 14px; color: #1f2937; line-height: 1.55; overflow-wrap: anywhere; }
.cm-body-deleted { color: #9ca3af; font-style: italic; }
.cm-deleted .cm-avatar { opacity: .5; }
.mention { color: #1e40af; background: #e8f0fb; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cm-flash .cm-bubble { animation: cm-flash 1.6s ease-out; }
@keyframes cm-flash { from { box-shadow: 0 0 0 3px #93c5fd; } to { box-shadow: 0 0 0 0 transparent; } }
.cm-form { border-top: 1px solid #f1f5f9; padding-top: 14px; }
.cm-input-wrap { position: relative; }
.cm-input-wrap textarea { resize: vertical; min-height: 76px; }
.cm-suggest { position: absolute; z-index: 20; left: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; width: min(340px, 100%); background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 10px 25px rgba(15, 23, 42, .12); }
.cm-suggest li { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.cm-suggest li .cm-avatar { grid-row: span 2; }
.cm-suggest li.active, .cm-suggest li:hover { background: #eff4ff; }
.cm-s-name { font-size: 13px; font-weight: 600; color: #111827; }
.cm-s-meta { font-size: 11px; color: #6b7280; }
.cm-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.cm-readonly { border-top: 1px solid #f1f5f9; padding-top: 12px; }


/* Site-wide messages (e.g. "can't be deleted because ...") */
.flash-messages .alert-error, .flash-messages .alert-success { margin: 0 0 16px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; border-radius: 8px; padding: 12px 16px; margin: 16px 0; font-size: 14px; }
/* Workflow designer */
.wf-warning { font-size: 12px; color: #b91c1c; font-weight: 600; margin-top: 2px; }
.wf-check-label { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.wf-check-label input { width: auto; margin: 0; }


/* Workflow stage editor: conditions */
.cond-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; padding: 8px 0; border-top: 1px dashed #e5e7eb; }
.cond-row > select.cond-field { flex: 1 1 170px; }
.cond-row > select.cond-operator { flex: 1 1 130px; }
.cond-row .cond-val { flex: 2 1 220px; display: flex; gap: 6px; align-items: center; }
.cond-row .cond-val select, .cond-row .cond-val input[type=text] { width: 100%; }
.cond-row .cond-to { display: flex; gap: 6px; align-items: center; }
.cond-unit { font-size: 12px; color: #6b7280; white-space: nowrap; }
.cond-row .remove-cond { padding: 2px 8px; }
.ms { flex-direction: column; align-items: stretch !important; border: 1px solid #d1d5db; border-radius: 6px; padding: 6px; background: #fff; }
.ms .ms-filter { margin: 0 0 4px; padding: 5px 8px; font-size: 13px; }
.ms-list { display: block; max-height: 150px; overflow-y: auto; }
.ms-list label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; margin: 0; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.ms-list label:hover { background: #f1f5f9; }
.ms-list input { width: auto; margin: 0; }
.ms-count { font-size: 11px; color: #6b7280; margin-top: 4px; }
.role-hint { display: none; font-size: 12px; color: #6b7280; flex-basis: 100%; }
/* Workflow list: active toggle */
.wf-active-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; cursor: pointer; }
.wf-active-toggle input { width: auto; margin: 0; }
.wf-inactive td { color: #9ca3af; }
.wf-inactive td a { color: #6b7280; }
.wf-badge-inactive { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #e5e7eb; color: #4b5563; margin-inline-start: 6px; }


/* Workflow tester */
.wt-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .wt-layout { grid-template-columns: 1fr; } }
.wt-form h3 { margin-top: 0; }
.wt-form p { margin-bottom: 12px; }
.wt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt-results .card { margin-bottom: 12px; }
.wt-workflow { margin: 0 0 6px; }
.wt-outcome { border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.wt-outcome-approval { background: #eff6ff; color: #1e40af; }
.wt-outcome-signature { background: #fffbeb; color: #92400e; }
.wt-stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wt-stage-skipped { opacity: .75; }
.wt-why { font-size: 13px; color: #374151; margin-top: 4px; }
.wt-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-inline-start: auto; }
.wt-checks .wt-pill { margin-inline-start: 0; margin-inline-end: 6px; }
.wt-pill-ok { background: #dcfce7; color: #15803d; }
.wt-pill-skip { background: #e5e7eb; color: #4b5563; }
.wt-pill-warn { background: #fef3c7; color: #92400e; }
.wt-pill-info { background: #e8f0fb; color: #1c5cab; }
.wt-steps { margin: 10px 0 0; padding-inline-start: 22px; font-size: 14px; }
.wt-steps li { padding: 3px 0; }
.wt-src { font-size: 12px; color: #6b7280; margin-inline-start: 6px; }
.wt-unassigned { color: #b91c1c; font-weight: 600; }
.wt-note { font-size: 12px; margin-top: 6px; }
.wt-rules { margin-top: 10px; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.wt-rules summary { cursor: pointer; font-size: 13px; color: #2563eb; font-weight: 500; }
.wt-rule { border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 13px; }
.wt-rule ul { margin: 6px 0 0; padding-inline-start: 18px; list-style: none; }
.wt-rule-yes { background: #f0fdf4; border: 1px solid #bbf7d0; }
.wt-rule-no { background: #f9fafb; border: 1px solid #eef2f7; color: #6b7280; }
.wt-mark { font-weight: 700; margin-inline-end: 4px; }
.wt-rule-yes .wt-mark, .wt-c-yes { color: #15803d; }
.wt-rule-no .wt-mark, .wt-c-no { color: #b91c1c; }
.wt-checks { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.wt-checks li { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.wt-detail-checks { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* Three-dot menu: Delete (a form button) looks like the links, in red */
.row-menu-panel.wf-menu { min-width: 220px; }
.row-menu-panel form { margin: 0; border-top: 1px solid #f1f5f9; margin-top: 4px; padding-top: 4px; }
.row-menu-panel .row-menu-danger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 6px; background: none; color: #dc2626; font-size: 13px; font-weight: 500; text-align: start; cursor: pointer; font-family: inherit; }
.row-menu-panel .row-menu-danger:hover { background: #fef2f2; color: #b91c1c; }


/* Renewals */
.rn-fields { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px 4px; margin: 0 0 16px; }
.rn-fields legend { font-size: 13px; font-weight: 600; color: #374151; padding: 0 6px; }
.rn-fields .rn-auto { margin-bottom: 10px; }
.rn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .rn-row { grid-template-columns: 1fr; } }
.rn-fields .rn-term input { border-color: #d1d5db; }
.rn-fields.rn-is-auto .rn-term label::after { content: " *"; color: #b91c1c; }
.rn-summary { margin-top: 16px; border-top: 1px solid #f1f5f9; padding-top: 12px; }
.rn-summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: #374151; }
.rn-summary-head a { font-size: 13px; color: #2563eb; text-decoration: none; }
.rn-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: #e5e7eb; color: #4b5563; }
.rn-pill-on { background: #dcfce7; color: #15803d; }
.rn-left { font-size: 12px; color: #6b7280; margin-inline-start: 4px; }
.rn-left-soon { color: #92400e; font-weight: 600; }
.rn-left-past { color: #b91c1c; font-weight: 600; }
.status-alt-banner.renewed { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.status-alt-banner.renewed a { color: #1e40af; font-weight: 600; }
.badge-renewed { background: #dbeafe; color: #1e40af; }
.type-renewal { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.family-item.type-renewal .family-dot { border-color: #10b981; }
.family-status.status-renewed { background: #dbeafe; color: #1e40af; }
.ob-auto { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; }


/* Compare versions */
.cmp-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cmp-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: start; }
.cmp-head h1 { margin: 0; }
.cmp-pick { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.cmp-pick label { font-size: 12px; font-weight: 600; color: #6b7280; margin: 0; }
.cmp-pick select { min-width: 220px; margin-top: 4px; }
.cmp-swap { background: #fff; color: #374151; border: 1px solid #d1d5db; padding: 8px 10px; font-size: 16px; line-height: 1; }
.cmp-swap:hover { background: #f9fafb; }
.cmp-meta { grid-column: 1 / -1; font-size: 13px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.cmp-vtag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #fee2e2; color: #991b1b; margin-inline-end: 4px; }
.cmp-vtag-new { background: #dcfce7; color: #166534; }
.cmp-toolbar { position: sticky; top: 60px; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(15, 23, 42, .06); }
.cmp-stats { display: flex; gap: 12px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.cmp-stat-ins { color: #166534; font-weight: 600; }
.cmp-stat-del { color: #b91c1c; font-weight: 600; }
.cmp-legend { font-size: 13px; display: flex; gap: 8px; }
.cmp-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.cmp-nav { padding: 5px 10px; font-size: 13px; }
.cmp-pos { font-size: 13px; color: #6b7280; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.cmp-only { font-size: 13px; margin: 0 6px 0 0; }
.cmp-doc { font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.7; color: #1f2937; padding: 28px 36px; }
.cmp-doc .cmp-p { margin: 0 0 10px; }
.cmp-doc .cmp-changed { border-inline-start: 3px solid #f59e0b; padding-inline-start: 12px; margin-inline-start: -15px; }
.cmp-doc .cmp-focus { background: #fffbeb; border-radius: 4px; }
.cmp-doc ins, .cmp-legend ins { background: #dcfce7; color: #14532d; text-decoration: underline; text-decoration-color: #16a34a; text-underline-offset: 3px; padding: 0 1px; border-radius: 2px; }
.cmp-doc del, .cmp-legend del { background: #fee2e2; color: #7f1d1d; text-decoration: line-through; text-decoration-color: #dc2626; padding: 0 1px; border-radius: 2px; }
.cmp-doc.cmp-only-changes .cmp-same:not(.cmp-context) { display: none; }
.cmp-doc .cmp-context { color: #6b7280; }
.cmp-gap { text-align: center; color: #9ca3af; font-family: inherit; font-size: 12px; margin: 6px 0 14px; letter-spacing: .3px; }
.cmp-print-head { display: none; }
@media (max-width: 760px) { .cmp-head { grid-template-columns: 1fr; } .cmp-doc { padding: 18px; } }
@media print {
    .navbar, .sidebar, .no-print, .flash-messages { display: none !important; }
    .app-shell > .page { padding: 0 !important; }
    .cmp-doc { border: none; box-shadow: none; padding: 0; }
    .cmp-print-head { display: block; font-family: sans-serif; font-size: 12px; color: #6b7280; }
    .cmp-head { border: none; box-shadow: none; }
    .cmp-doc ins, .cmp-doc del { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* Pop-up dialogs opened from the request sidebar keep normal dialog styling */
.detail-sidebar .action-list .ob-dialog { text-align: start; font-size: 14px; }
.detail-sidebar .action-list .ob-dialog label { display: block; margin: 0 0 4px; }
.detail-sidebar .action-list .ob-dialog .ob-dialog-actions .btn { width: auto; }
.detail-sidebar .action-list .ob-dialog .btn.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; box-shadow: none; }
.detail-sidebar .action-list .ob-dialog .btn.btn-secondary:hover { background: #f9fafb; color: #111827; border-color: #9ca3af; box-shadow: none; }


/* Upload: final signed copy */
.fsc-box { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; background: #fafbfc; }
.fsc-box.fsc-on { border-color: #86efac; background: #f0fdf4; }
.fsc-box .fsc-date { display: none; margin: 12px 0 0; max-width: 240px; }
.fsc-box.fsc-on .fsc-date { display: block; }
.fsc-req { color: #b91c1c; }
.fsc-tag { font-size: 11px; color: #15803d; font-weight: 600; margin-top: 2px; }

.fsc-box .fsc-warn { display: none; font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 6px 10px; margin-top: 8px; }
.fsc-box.fsc-on .fsc-warn { display: block; }


/* User groups */
.ug-flags { display: flex; gap: 24px; flex-wrap: wrap; margin: 4px 0 18px; }
.ug-members-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ug-members-head input[type=search] { width: 100%; max-width: 320px; margin: 0; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; }
.ug-table-wrap { border: 1px solid #e5e7eb; border-radius: 8px; max-height: 420px; overflow-y: auto; }
.ug-table th { position: sticky; top: 0; z-index: 1; }
.ug-table td, .ug-table th { padding: 8px 12px; }
.ug-table input[type=checkbox] { width: auto; margin: 0; }
.ug-row { cursor: pointer; }
.ug-inactive td { color: #9ca3af; }


/* Supporting documents rows (wizard) */
.sd-row { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.sd-row input, .sd-row select { margin: 0; }
.sd-row .sd-remove { padding: 4px 9px; }
@media (max-width: 640px) { .sd-row { grid-template-columns: 1fr; } }
.ft-types { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 12px; max-height: 220px; overflow-y: auto; }
.ft-types label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; }
.ft-types input { width: auto; margin: 0; }

/* Intake form auto-assignment: Vault list and rule editor */
.aa-table td { vertical-align: top; }
.aa-order form { display: flex; gap: 2px; margin: 0; }
.aa-move { background: none; border: 1px solid #e5e7eb; color: #4b5563; border-radius: 6px; padding: 0 7px; line-height: 22px; cursor: pointer; }
.aa-move:hover:not(:disabled) { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.aa-move:disabled { opacity: .35; cursor: default; }
.aa-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.aa-list li { padding: 2px 0; }
.aa-joiner { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #6b7280; }
.aa-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: #e8f0fb; color: #1c5cab; margin-inline-start: 4px; }
.aa-pill-locked { background: #fef3c7; color: #92400e; }
.row-menu-panel .row-menu-plain { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 6px; background: none; color: #1f2937; font-size: 13px; text-align: start; cursor: pointer; font-family: inherit; }
.row-menu-panel .row-menu-plain:hover { background: #eff6ff; color: #1d4ed8; }
.aa-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.aa-head .aa-active { margin-bottom: 18px; }
.aa-section { border: 1px solid #eef0f4; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: #fafbfc; }
.aa-section h3 { margin: 0 0 4px; font-size: 15px; }
.aa-section > .ob-muted { margin: 0 0 10px; font-size: 12px; }
.aa-target-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px dashed #e5e7eb; }
.aa-target-row > .aa-target-field { flex: 1 1 200px; }
.aa-target-row .aa-val { flex: 2 1 240px; display: flex; gap: 6px; align-items: center; }
.aa-target-row .aa-val select, .aa-target-row .aa-val input:not([type=checkbox]) { width: 100%; }
.aa-equals { font-weight: 700; color: #6b7280; padding-top: 8px; }
.aa-allow { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; margin: 0; white-space: nowrap; }
.aa-allow select { width: auto; }
.aa-target-row .remove-target { padding: 2px 8px; }
.aa-types { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.aa-types label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; margin: 0; cursor: pointer; }
.aa-types input { width: auto; margin: 0; }
.aa-types-off { opacity: .45; }

/* Intake form auto-assignment: New Request wizard */
.aa-note { display: block; font-size: 12px; color: #1c5cab; margin-top: 3px; }
.aa-note.aa-locked { color: #92400e; }
.aa-note.aa-locked::before { content: "\1F512\00a0"; }
.aa-assignee { margin-bottom: 8px; }
.aa-pending { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.aa-pending ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* Signature auto-assignment: rule editor signatory rows and the Prepare for Signature screen */
.sr-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.sr-row select { flex: 1; }
.sr-row .sr-remove { padding: 2px 8px; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px dashed #e5e7eb; }
.sg-row .sg-fields { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 420px; }
.sg-row .sg-kind { flex: 0 0 170px; }
.sg-row .sg-user, .sg-row .sg-name, .sg-row .sg-email { flex: 1 1 180px; margin: 0; }
.sg-row .sg-actions { display: flex; gap: 4px; }
.sg-row .sg-remove { padding: 2px 8px; }
.sg-row .aa-note { flex-basis: 100%; margin-inline-start: 28px; }

/* Undo final signed copy */
.ob-dialog .btn.btn-danger-solid, .action-list .ob-dialog .btn.btn-danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.ob-dialog .btn.btn-danger-solid:hover, .action-list .ob-dialog .btn.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }
.undo-list { margin: 0 0 12px; padding-inline-start: 18px; font-size: 13px; color: #374151; }
.undo-list li { margin: 4px 0; }
.undo-list .undo-effect { color: #92400e; }
tr.doc-undone td { color: #9ca3af; }
tr.doc-undone .file-name { text-decoration: line-through; color: #9ca3af; }
.doc-undone-tag { font-size: 11px; color: #b45309; font-weight: 600; margin-top: 2px; }
.sg-row .sg-order { flex: 0 0 64px; width: 64px; margin: 0; text-align: center; }
.sig-cc-title { font-size: 14px; margin: 22px 0 8px; }

/* Data import (Vault > Import Agreements) */
.imp-steps { margin: 18px 0 0; padding-inline-start: 20px; display: grid; gap: 16px; }
.imp-steps li { display: grid; gap: 6px; justify-items: start; }
.imp-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.imp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.imp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 4px; }
.imp-tile { border: 1px solid #e5e7eb; border-inline-start: 4px solid #94a3b8; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #6b7280; }
.imp-tile span { display: block; font-size: 24px; font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
.imp-tile.is-ok { border-inline-start-color: #15803d; }
.imp-tile.is-error { border-inline-start-color: #dc2626; background: #fef2f2; }
.imp-tile.is-warning { border-inline-start-color: #d97706; background: #fffbeb; }
.imp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.imp-two h3 { font-size: 15px; margin: 0 0 8px; }
.imp-scroll { overflow-x: auto; }
.imp-row-error td { background: #fef2f2; }
.imp-confirm { margin: 0 0 10px; padding-inline-start: 18px; font-size: 14px; display: grid; gap: 4px; }

.imp-attach { display: grid; gap: 10px; margin-top: 14px; }
.imp-match { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 14px; margin: 0; display: grid; gap: 6px; }
.imp-match legend { font-size: 13px; font-weight: 600; color: #374151; padding: 0 4px; }
.imp-match label { font-size: 14px; font-weight: normal; }
a.imp-tile { text-decoration: none; }
a.imp-tile:hover { border-color: #93c5fd; }

/* Mandatory field marker */
.req-star { color: #dc2626; margin-inline-start: 3px; font-weight: 600; }
.req-note { margin: 0 0 8px; font-size: 14px; }
.mf-type-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; }
.mf-type-pick select { width: auto; min-width: 220px; }
.mf-step { margin-top: 18px; }
.mf-step h3 { font-size: 14px; margin: 0 0 6px; color: #374151; }
.mf-table td:last-child, .mf-table th:last-child { width: 130px; text-align: center; }
.mf-always { font-size: 12px; color: #6b7280; }
.mf-kind { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #ecfeff; color: #0f766e; margin-inline-start: 6px; }

/* ---- Condition builder: nested AND / OR groups (vault/_cond_builder.html) ---- */
.cond-builder { font-size: 13px; }
.cond-group { border: 1px solid #dbe3ee; border-inline-start: 4px solid #93c5fd; border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #f8fafc; }
.cond-group .cond-group { border-inline-start-color: #c4b5fd; background: #fff; }
.cond-group .cond-group .cond-group { border-inline-start-color: #93c5fd; background: #f8fafc; }
.cond-group-root, .cond-group .cond-group-root { border: none; padding: 0; margin: 0; background: none; }
.cond-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cond-group-head select.cond-group-op { flex: 0 1 280px; }
.cond-group-head .cond-group-remove { padding: 2px 8px; margin-inline-start: auto; }
.cond-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1e40af; }
.cond-items { margin-top: 4px; }
.cond-items > .cond-row { border-top: none; padding: 4px 0; }
.cond-num { flex: 0 0 auto; min-width: 22px; height: 22px; margin-top: 7px; border-radius: 999px; background: #e5e7eb; color: #374151; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cond-joiner { display: block; margin: 2px 0; padding: 1px 10px; border-radius: 999px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; font-size: 11px; font-weight: 700; letter-spacing: .04em; cursor: pointer; font-family: inherit; }
.cond-joiner-or { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.cond-joiner:hover { filter: brightness(.96); }
.cond-group-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cond-group-actions .btn { padding: 2px 10px; font-size: 12px; }
.cond-preview { margin-top: 8px; padding: 5px 10px; border-radius: 6px; background: #f1f5f9; color: #374151; font-size: 12px; }
.cond-preview code { font-size: 12px; font-weight: 600; white-space: pre-wrap; }
.cond-builder .no-cond-hint { display: block; margin-top: 4px; font-size: 12px; color: #9ca3af; }
/* Read-only view of nested groups (vault/_cond_expr.html) */
.aa-list.cx-group { margin: 2px 0 2px 2px; padding-inline-start: 10px; border-inline-start: 2px solid #93c5fd; }
.cx-group-label { font-size: 11px; color: #6b7280; }
.wt-rule .aa-list { list-style: none; padding-inline-start: 18px; margin: 6px 0 0; }
.wt-rule .aa-list.cx-group { padding-inline-start: 10px; margin: 2px 0; }

/* Contracts list: three-dot menu per row */
.row-menu-panel.dash-menu { min-width: 210px; }
.row-menu-panel .row-menu-disabled, .row-menu-panel .row-menu-disabled:hover { color: #9ca3af; background: none; cursor: default; }

/* Contracts list filters: all fields on one line, buttons below */
.dash-filters { margin-bottom: 16px; }
.dash-filter-row { display: grid; grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; }
.dash-filter { min-width: 0; }
.dash-filter label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-filter .form-control { width: 100%; min-width: 0; font-size: 13px; padding: 7px 8px; box-sizing: border-box; }
.dash-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
@media (max-width: 900px) { .dash-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.aa-pill-off { background: #f1f5f9; color: #64748b; }

/* Vault > Audit Log */
.audit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.audit-filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.audit-failed { display: flex; align-items: center; min-height: 34px; }
@media (max-width: 900px) { .audit-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audit-table td { font-size: 13px; vertical-align: top; }
.audit-failed-row td { background: #fef2f2; }
.audit-fail-label { color: #b91c1c; }
.audit-changes { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: #4b5563; }
.audit-field { font-weight: 600; color: #374151; }
.audit-old { color: #6b7280; text-decoration: line-through; }
.audit-new { color: #15803d; }
.audit-cat { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #e8f0fb; color: #1c5cab; white-space: nowrap; }
.audit-cat-signin { background: #f1f5f9; color: #334155; }
.audit-cat-license { background: #fef3c7; color: #92400e; }
.audit-cat-settings { background: #ede9fe; color: #5b21b6; }
.audit-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* Platform version (sidebar, sign-in page) */
.side-version { padding: 6px 12px 2px; font-size: 11px; color: #9ca3af; }
.auth-version { color: #9ca3af; margin-inline-start: 4px; }

/* Notification bell (top bar) and Notifications page */
.bell-menu { position: relative; }
.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08); color: #e5e7eb; cursor: pointer; padding: 0; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: rgba(255,255,255,0.16); color: #fff; }
.bell-count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; border: 2px solid #0f172a; }
.bell-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .2); z-index: 60; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.bell-head form { margin: 0; }
.bell-link { background: none; border: none; color: #2563eb; font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
.bell-link:hover { text-decoration: underline; }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid #f8fafc; color: #1f2937; text-decoration: none; font-size: 13px; }
.bell-item:hover { background: #f8fafc; }
.bell-unread { background: #eff6ff; }
.bell-unread:hover { background: #e0ecff; }
.bell-icon { flex: 0 0 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #e5e7eb; color: #374151; }
.bell-icon-comment_mention { background: #ede9fe; color: #6d28d9; }
.bell-icon-approval_request, .bell-icon-approval_reminder { background: #dbeafe; color: #1e40af; }
.bell-icon-request_rejected, .bell-icon-obligation_overdue, .bell-icon-contract_expired { background: #fee2e2; color: #b91c1c; }
.bell-icon-request_approved, .bell-icon-contract_active { background: #dcfce7; color: #15803d; }
.bell-icon-obligation_due, .bell-icon-contract_expiring, .bell-icon-missing_dates { background: #fef3c7; color: #92400e; }
.bell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bell-msg { line-height: 1.35; }
.bell-unread .bell-msg { font-weight: 600; }
.bell-detail { color: #6b7280; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-time { color: #9ca3af; font-size: 11px; }
.bell-dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 999px; background: #2563eb; }
.bell-empty { padding: 24px 14px; text-align: center; color: #9ca3af; font-size: 13px; }
.bell-all { display: block; padding: 10px 14px; text-align: center; font-size: 13px; color: #2563eb; text-decoration: none; border-top: 1px solid #f1f5f9; }
.bell-all:hover { background: #f8fafc; }
.notif-tabs { display: flex; gap: 6px; margin: 14px 0 8px; }
.notif-tabs a { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: #4b5563; text-decoration: none; border: 1px solid #e5e7eb; }
.notif-tabs a.active { background: #1e40af; color: #fff; border-color: #1e40af; }
.notif-page-list { max-height: none; border: 1px solid #f1f5f9; border-radius: 8px; }
.bell-caughtup { padding: 8px 14px; font-size: 12px; color: #15803d; background: #f0fdf4; border-bottom: 1px solid #f1f5f9; }
/* The top bar's link/button styles mustn't reach into the bell panel. */
.navbar .bell-panel a { margin: 0; font-weight: normal; }
.navbar .bell-panel a.bell-item, .navbar .bell-panel a.bell-item:hover { color: #1f2937; font-size: 13px; }
.navbar .bell-panel a.bell-all, .navbar .bell-panel a.bell-all:hover { color: #2563eb; font-size: 13px; }
.navbar .bell-panel .bell-link, .navbar .bell-panel .bell-link:hover { color: #2563eb; font-size: 12px; }
.bell-section { padding: 8px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #9ca3af; }

/* Profile pictures (top bar, Vault > Users, My profile) */
.profile-avatar-img { object-fit: cover; background: #e5e7eb; display: inline-block; }
.profile-avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.user-cell { display: inline-flex; align-items: center; gap: 8px; }
.me-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.me-name { font-size: 17px; font-weight: 600; }
.me-photo { display: flex; flex-direction: column; gap: 4px; }
.me-photo input[type=file] { font-size: 13px; }
.user-form-photo { flex-direction: row; align-items: center; gap: 14px; margin-bottom: 14px; }
.user-form-photo > div { display: flex; flex-direction: column; gap: 4px; }
.me-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 18px 0 8px; font-size: 14px; }
.me-details dt { color: #6b7280; }
.me-details dd { margin: 0; }
.profile-panel a.profile-panel-link { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; color: #1f2937; font-size: 14px; border-top: 1px solid #f1f5f9; }
.profile-panel a.profile-panel-link:hover { background: #f8fafc; color: #1d4ed8; }

/* ---------- Logo mark next to the "Contralio" name ---------- */
.brand-mark {
    width: 1.35em;
    height: 1.35em;
    vertical-align: middle;
    position: relative;
    top: -0.08em;
    margin-inline-end: 0.4em;
    border-radius: 0.3em;
}
