:root {
    --echo-dark: #1f2937;
    --echo-grey: #6b7280;
    --echo-grey-soft: #e5e7eb;
    --echo-accent: #a53732;
    --echo-accent-soft: #eef9e4;
    --echo-bg: #f6f8fc;
    --echo-text: #0f172a;
    --echo-header-bg: #404040;
    --echo-nav-text: #bababa;
}
body { background: var(--echo-bg); color: var(--echo-text); }
a { color: var(--echo-accent); }
a:hover { color: #8f2f2b; }
.content-wrapper { background: #f4f6f9; min-height: calc(100vh - 57px); }
.app-content { max-width: 1280px; margin: 0 auto; padding: 20px 14px; }
.card { margin-bottom: 1rem; border-radius: 0.5rem; padding: 1rem 1.1rem; }
.card h2, .card h3 { margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }
label { display: block; margin: 10px 0 4px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]), textarea, select { width: 100%; box-sizing: border-box; }
form + form, .card form { margin-top: 0.5rem; }
textarea { min-height: 90px; resize: vertical; }
.muted { color: #5f6c7b; }
.flash-success, .flash-error { margin-bottom: 1rem; }
.flash-success { background: #ecfdf3; border: 1px solid #86efac; color: #14532d; padding: 10px; border-radius: 6px; }
.flash-error { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; padding: 10px; border-radius: 6px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.9rem;
    padding-right: 2px;
}
.page-header h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 600;
    color: #1f2937;
}
.page-header .right-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.page-breadcrumb {
    margin-bottom: 0.9rem;
}
.page-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}
.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item a {
    font-size: 0.88rem;
    color: #64748b;
}
.page-breadcrumb .breadcrumb-item.active {
    color: #334155;
}
.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(420px, 1.35fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}
.table-responsive { margin-top: 0.5rem; }
th,
td {
    vertical-align: top !important;
}
.table .btn { white-space: nowrap; }
table.dataTable th,
table.dataTable td {
    white-space: normal !important;
    word-break: break-word;
}
.status-cell {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    width: 1%;
}
.table td.status-cell,
.table th.status-cell,
table.dataTable td.status-cell,
table.dataTable th.status-cell {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}
.dataTables_wrapper .dataTables_filter {
    float: right !important;
    text-align: right !important;
}
.dataTables_wrapper .dataTables_filter input {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    max-width: 100%;
}
.status-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
    min-width: max-content;
}
.status-active { background: #d1fae5; color: #065f46; }
.status-archived { background: #e5e7eb; color: #374151; }
.status-handover-pending { background: #fef3c7; color: #92400e; }
.status-pending-renewal { background: #dbeafe; color: #1e40af; }
.status-expired { background: #fee2e2; color: #991b1b; }
.status-draft { background: #ede9fe; color: #5b21b6; }
.section-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-box { background: #fff; border: 1px solid #e3e8f0; border-radius: 8px; padding: 14px; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi-label { color: #5f6c7b; font-size: 0.9rem; }
.navbar-echo {
    background: var(--echo-header-bg);
    border-bottom: 1px solid #323232;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.navbar-echo .nav-link {
    color: var(--echo-nav-text) !important;
    border-radius: 8px;
    margin-right: 4px;
    padding: 0.5rem 0.9rem !important;
    font-weight: 500;
}
.navbar-echo .nav-link:hover,
.navbar-echo .nav-link:focus,
.navbar-echo .nav-link.active {
    background: #bababa;
    color: #a53732 !important;
}
.navbar-echo .navbar-toggler {
    border-color: var(--echo-grey-soft);
    color: var(--echo-nav-text);
}
.brand-logo-img {
    height: 34px;
    width: auto;
    display: block;
}
.brand-subtitle {
    display: block;
    font-size: 0.72rem;
    color: var(--echo-grey);
    margin-top: 2px;
}
.portal-footer {
    border-top: 1px solid var(--echo-grey-soft);
    background: #fff;
    color: var(--echo-grey);
    font-size: 0.88rem;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-brand img {
    height: 28px;
    width: auto;
    display: block;
}
.portal-footer a {
    color: var(--echo-dark);
    text-decoration: none;
}
.portal-footer a:hover {
    color: #111827;
    text-decoration: underline;
}
.btn-primary {
    background-color: #a53732;
    border-color: #a53732;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #8f2f2b;
    border-color: #8f2f2b;
}
input.form-check-input[type=checkbox],
input.form-check-input[type=radio] {
    position: static;
    width: auto;
    margin: 0 0.45rem 0 0;
    vertical-align: middle;
}
.inline-check {
    display: block;
    margin: 0.35rem 0 0.15rem;
}
.inline-check label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-weight: 500;
    color: #4b5563;
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header .right-actions { justify-content: flex-start; }
    .split-layout { grid-template-columns: 1fr; }
    .app-content { padding: 16px 10px; }
}
@media (max-width: 520px) {
    .kpi-grid { grid-template-columns: 1fr; }
}
