/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 270px;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    border-right: 1px solid #eee;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 0 20px;
    margin-bottom: 16px;
    text-align: center;
}

.logo-svg-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.logo-main-text {
    font-size: 26px;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.logo-main-text .orange-dot {
    color: #ff6600;
}

.logo-subtext {
    font-size: 9px;
    color: #888;
    letter-spacing: 1px;
    margin-top: 2px;
}

.area-badge {
    margin: 0 20px 16px 20px;
    background: #ff6600;
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
}

.area-badge h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 2px;
}

.area-badge p {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
}

.sidebar-search {
    margin: 0 20px 20px 20px;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: #f9f9f9;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search input:focus {
    border-color: #ff6600;
}

.sidebar-search .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 20px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: #fff5ee;
    color: #ff6600;
}

.nav-item.active {
    color: #ff6600;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #ff6600;
    border-radius: 0 4px 4px 0;
}

.nav-item .material-icons-outlined {
    font-size: 22px;
    color: #555;
}

.nav-item.active .material-icons-outlined,
.nav-item:hover .material-icons-outlined {
    color: #ff6600;
}

.nav-item.sub {
    font-size: 13px;
    padding: 10px 14px;
    gap: 0;
}

.nav-item.sub .material-icons-outlined {
    display: none;
}

.collapse-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 6px 14px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
}

.collapse-link .material-icons-outlined {
    font-size: 16px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 14px 6px;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.sidebar-user .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ddd;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-user .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-user .user-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 24px 28px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.top-bar h1 {
    font-size: 32px;
    font-weight: 800;
    color: #ff6600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar h1 a {
    color: #ff6600;
    display: flex;
    align-items: center;
}

.top-bar h1 .material-icons-outlined {
    font-size: 28px;
}

.top-bar-icons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-icons .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.top-bar-icons .icon-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.top-bar-icons .icon-btn .material-icons-outlined {
    font-size: 22px;
    color: #333;
}

/* ===== SHARED UI ===== */
.page-card {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card {
    background: #f3f3f3;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-white {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: #ff6600;
    margin-bottom: 18px;
}

.section-title.dark {
    color: #1a1a1a;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #ff6600;
    color: #fff;
}

.btn-primary:hover {
    background: #e55a00;
}

.btn-dark {
    background: #1a1a1a;
    color: #fff;
}

.btn-dark:hover {
    background: #333;
}

.btn-outline {
    background: transparent;
    color: #ff6600;
    border: 2px solid #ff6600;
}

.btn-outline:hover {
    background: #fff5ee;
}

.btn-outline-dark {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.toolbar-left {
    justify-content: flex-start;
}

.toolbar-between {
    justify-content: space-between;
}

.search-pill {
    display: flex;
    align-items: center;
    background: #eee;
    border-radius: 24px;
    padding: 8px 16px;
    gap: 8px;
    min-width: 180px;
}

.search-pill input {
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    width: 100%;
}

.search-pill .material-icons-outlined {
    color: #888;
    font-size: 20px;
}

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

.stat-card .stat-label {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.stat-card .stat-change {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.stat-change.up { color: #22c55e; }
.stat-change.down { color: #ef4444; }

/* ===== DATA TABLE ===== */
.data-table-wrap {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table thead th {
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
}

.data-table thead th:first-child {
    border-radius: 10px 0 0 10px;
}

.data-table thead th:last-child {
    border-radius: 0 10px 10px 0;
}

.data-table tbody td {
    padding: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
}

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

.data-table tbody tr:hover {
    background: rgba(255,102,0,0.04);
}

.data-table .highlight {
    color: #ff6600;
    font-weight: 600;
}

.data-table .link-orange {
    color: #ff6600;
    font-weight: 600;
}

/* ===== INFO GRID ===== */
.info-grid {
    display: grid;
    gap: 12px;
}

.info-cell {
    background: #f0f0f0;
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
}

.info-cell .label {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.info-cell .value {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    line-height: 1.4;
}

/* ===== FOLDER GRID ===== */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-align: center;
}

.folder-item:hover,
.folder-item.active {
    border-color: #ff6600;
    background: #fff8f3;
}

.folder-icon {
    width: 56px;
    height: 48px;
    background: #ff6600;
    border-radius: 4px 8px 6px 6px;
    position: relative;
}

.folder-icon::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    width: 22px;
    height: 10px;
    background: #ff6600;
    border-radius: 4px 4px 0 0;
}

.folder-item span {
    font-size: 11px;
    font-weight: 500;
    color: #444;
    line-height: 1.3;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button,
.pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: #e5e5e5;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #555;
    cursor: pointer;
}

.pagination .page-num {
    background: #d0d0d0;
    font-weight: 600;
}

/* ===== SPLIT LAYOUTS ===== */
.split-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.split-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.split-folder-preview {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.split-list-preview {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.split-profile-text {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 16px;
}

.split-person-statement {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* ===== PERSON CARD ===== */
.person-card {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
}

.person-card .photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 14px;
    background: #ddd;
    display: block;
}

.person-card .photo.square {
    border-radius: 16px;
    width: 160px;
    height: 160px;
}

.person-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.person-card h3.orange {
    color: #ff6600;
}

.person-card .meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 12px;
}

.person-card .details {
    text-align: left;
    font-size: 12px;
    color: #555;
    line-height: 1.7;
}

.person-card .details .d-row {
    display: flex;
    gap: 6px;
}

.person-card .details .d-label {
    font-weight: 600;
    min-width: 90px;
    color: #333;
}

/* ===== STATEMENT CARD ===== */
.statement-card {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 24px;
    font-size: 13px;
    line-height: 1.7;
    color: #444;
}

.statement-card p {
    margin-bottom: 12px;
}

/* ===== LIST MENU ===== */
.list-menu {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 24px 20px;
}

.list-menu h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.list-menu a {
    display: block;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    border-radius: 8px;
    transition: all 0.15s;
}

.list-menu a:hover {
    background: #fff5ee;
    color: #ff6600;
}

.list-menu a.active {
    color: #ff6600;
    font-weight: 600;
}

/* ===== PROGRESS RING ===== */
.progress-ring-card {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 14px;
}

.progress-ring svg {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.progress-ring .track {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 10;
}

.progress-ring .fill {
    fill: none;
    stroke: #ff6600;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 117;
}

.progress-ring .center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-ring .center-text .pct {
    font-size: 28px;
    font-weight: 800;
    color: #ff6600;
    display: block;
}

.progress-ring .center-text .sub {
    font-size: 12px;
    color: #888;
}

.progress-ring-card .ring-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ===== SIMPLE LIST CARD ===== */
.simple-list-card {
    background: #f0f0f0;
    border-radius: 16px;
    padding: 20px;
}

.simple-list-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.simple-list-card ul {
    list-style: none;
}

.simple-list-card ul li {
    padding: 10px 0;
    font-size: 14px;
    color: #444;
    font-weight: 500;
    border-bottom: 1px solid #e5e5e5;
}

.simple-list-card ul li:last-child {
    border-bottom: none;
}

.crime-type-header {
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== SEARCH PAGE ===== */
.search-hero {
    background: #f0f0f0;
    border-radius: 20px;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.search-hero h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.search-bar-lg {
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #ff6600;
    border-radius: 30px;
    padding: 12px 20px;
    gap: 10px;
}

.search-bar-lg input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: transparent;
}

.search-bar-lg .material-icons-outlined {
    color: #ff6600;
    font-size: 24px;
}

.search-results {
    width: 100%;
    max-width: 700px;
    background: #fff;
    border: 2px solid #ff6600;
    border-top: none;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

.search-result-item {
    display: grid;
    grid-template-columns: 40px 1.2fr 1.2fr 1fr 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

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

.search-result-item:hover {
    background: #fff8f3;
}

.search-result-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    overflow: hidden;
}

.search-result-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-item .name {
    font-weight: 600;
    color: #1a1a1a;
}

.search-result-item .muted {
    color: #999;
    font-size: 12px;
}

/* ===== BIOMETRIC CARDS ===== */
.bio-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 0.9fr;
    gap: 14px;
}

.bio-card {
    background: #f0f0f0;
    border-radius: 14px;
    padding: 16px;
}

.bio-card .bio-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.fingerprint-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.fp {
    width: 100%;
    aspect-ratio: 3/4;
    background: #bbb;
    border-radius: 40% 40% 45% 45%;
    opacity: 0.7;
}

.family-row, .accomplice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mini-person {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.mini-person .dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff6600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.mini-person .dot .material-icons-outlined {
    font-size: 18px;
}

.mini-person .mp-name {
    font-weight: 600;
    color: #1a1a1a;
}

.mini-person .mp-role {
    color: #888;
    font-size: 11px;
}

/* ===== CRIME LIST ===== */
.crime-list-card {
    background: #f0f0f0;
    border-radius: 14px;
    padding: 16px;
}

.crime-list-card .crime-list-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.crime-entry {
    margin-bottom: 14px;
}

.crime-entry .crime-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.crime-entry .crime-name.orange {
    color: #ff6600;
}

.crime-entry .crime-meta {
    font-size: 12px;
    color: #666;
    padding: 8px 12px;
    border-left: 3px solid #ddd;
    margin-left: 4px;
}

.crime-entry .crime-meta.highlight-box {
    background: #ff6600;
    color: #fff;
    border-left: none;
    border-radius: 6px;
    margin-left: 0;
}

/* ===== COURT DATES ===== */
.court-dates {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.court-date-item {
    background: #f0f0f0;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 160px;
}

.court-date-item .material-icons-outlined {
    color: #ff6600;
    font-size: 28px;
}

.court-date-item .cd-title {
    font-size: 13px;
    font-weight: 700;
    color: #ff6600;
}

.court-date-item .cd-sub {
    font-size: 11px;
    color: #777;
}

/* ===== CRIMINAL PROFILE REFINED ===== */
.profile-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #f0f0f0;
    border-radius: 14px;
    padding: 20px;
    flex-wrap: wrap;
}
.profile-avatar img,
.avatar-fallback {
    width: 110px;
    height: 110px;
    border-radius: 14px;
    object-fit: cover;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 44px;
    font-weight: 800;
    background: #ff6600;
}
.profile-main {
    flex: 1;
    min-width: 200px;
}
.profile-main h2 {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    color: #888;
    font-size: 13px;
    margin-bottom: 12px;
}
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.profile-contact {
    min-width: 280px;
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.info-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.info-row .info-line {
    flex: 1;
    min-width: 130px;
}
.info-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.info-line .info-label {
    font-size: 11px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}
.info-line .info-value {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.4;
}
.info-value-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.biometric-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.biometric-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.biometric-item .material-icons-outlined {
    color: #ff6600;
    font-size: 20px;
    flex-shrink: 0;
}
.empty-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 13px;
    padding: 8px 0;
    line-height: 1.5;
}
.empty-hint .material-icons-outlined {
    font-size: 20px;
    color: #bbb;
    flex-shrink: 0;
}
.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.kpi-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.kpi-value {
    font-size: 34px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.1;
}
.kpi-sub {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.split-gap {
    gap: 14px;
}
.report-grid {
    display: grid;
    grid-template-columns: 160px 160px 1.6fr;
    gap: 14px;
    align-items: stretch;
}

/* ===== ACTION ROW ===== */
.action-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.action-row.horizontal {
    flex-direction: row;
}

/* ===== DOCUMENT PREVIEW ===== */
.doc-preview {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    min-height: 420px;
    font-size: 11px;
    line-height: 1.6;
    color: #333;
}

.doc-preview .doc-header {
    text-align: center;
    margin-bottom: 20px;
}

.doc-preview .doc-crest {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: #e8e8e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-preview .doc-crest .material-icons-outlined {
    font-size: 28px;
    color: #666;
}

.doc-preview h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.doc-preview .doc-sub {
    font-size: 10px;
    color: #666;
}

.doc-preview .doc-body {
    margin-top: 16px;
}

.doc-preview .doc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 10px;
}

.doc-preview .doc-section-title {
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    margin: 16px 0 10px;
    text-transform: uppercase;
}

.doc-preview p {
    font-size: 10px;
    color: #444;
    margin-bottom: 8px;
    text-align: justify;
}

/* ===== TEXT TWO COL ===== */
.text-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
}

.text-two-col p {
    margin-bottom: 12px;
}

/* ===== DATE LIST ===== */
.date-list-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
}

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

.date-list-row .date-col {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.date-list-row .date-col .material-icons-outlined {
    color: #ff6600;
    font-size: 20px;
}

.date-list-row .conv-col {
    font-size: 14px;
    color: #444;
}

/* ===== CHECK ROW ===== */
.check-row {
    display: grid;
    grid-template-columns: 1fr 160px 60px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
}

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

.check-row label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff6600;
}

/* ===== DASHBOARD SPECIFIC ===== */
.middle-section {
    display: grid;
    grid-template-columns: 1fr 280px 200px;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chart-area {
    width: 100%;
    height: 200px;
    position: relative;
}

.chart-area canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.chart-legend span {
    font-size: 11px;
    color: #777;
    font-weight: 500;
}

.cases-today-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cases-today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cases-today-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cases-today-header .count {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a1a;
}

.case-entry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #333;
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.case-entry-row .case-icon {
    width: 36px;
    height: 36px;
    background: #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.case-entry-row .case-icon .material-icons-outlined {
    font-size: 18px;
    color: #ff6600;
}

.case-entry-row .case-info .case-name {
    font-size: 13px;
    font-weight: 600;
}

.case-entry-row .case-info .case-date {
    font-size: 11px;
    color: #aaa;
}

.right-panels {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.right-panel {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.right-panel .panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #ff6600;
    margin-bottom: 8px;
}

.right-panel .panel-list {
    list-style: none;
}

.right-panel .panel-list li {
    font-size: 12px;
    color: #555;
    padding: 3px 0;
    font-weight: 500;
}

.bottom-section {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
}

.recent-cases-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.recent-cases-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 14px;
}

.recent-cases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.recent-case-item {
    display: flex;
    flex-direction: column;
}

.recent-case-item .name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.recent-case-item .status {
    font-size: 11px;
    color: #888;
    font-weight: 400;
}

.progress-circle-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-circle {
    position: relative;
    width: 70px;
    height: 70px;
}

.progress-circle svg {
    width: 70px;
    height: 70px;
    transform: rotate(-90deg);
}

.progress-circle .track {
    fill: none;
    stroke: #e8e8e8;
    stroke-width: 6;
}

.progress-circle .fill {
    fill: none;
    stroke: #ff6600;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 188.5;
    stroke-dashoffset: 96.1;
}

.progress-circle .percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.stats-bottom-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-box {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-box .stat-box-label {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-box .stat-box-value {
    font-size: 34px;
    font-weight: 800;
    color: #1a1a1a;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: #f9f9f9;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #ff6600;
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #ff6600;
    color: #fff;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* ===== MODAL ===== */
.modal-content {
    border-radius: 14px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 16px 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 12px 20px;
}

/* ===== MISC UTILITIES ===== */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-muted { color: #888; }
.flex-1 { flex: 1; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0e17;
    background-image:
        linear-gradient(rgba(5,15,30,0.65), rgba(5,15,30,0.75)),
        url('../images/login_bg.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.55);
}

.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(20, 24, 35, 0.92);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-card .auth-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid rgba(255,255,255,0.15);
    display: block;
    background: #333;
}

.auth-card h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.auth-card .auth-name {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

.auth-field {
    margin-bottom: 16px;
    text-align: left;
}

.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: none;
    background: #e8e8e8;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
}

.auth-field input:focus {
    box-shadow: 0 0 0 2px #ffcc00;
}

.auth-reset {
    text-align: right;
    margin: -8px 0 16px;
}

.auth-reset a {
    color: #e85a4f;
    font-size: 12px;
    font-weight: 500;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background: #ffcc00;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #ffd633;
}

.pin-field {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: none;
    background: #e8e8e8;
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    letter-spacing: 12px;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.pin-hint {
    color: #888;
    font-size: 12px;
    margin-top: 10px;
}

/* ===== HAMBURGER ===== */
.hamburger {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #ff6600;
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,102,0,0.3);
}

.hamburger .material-icons-outlined {
    font-size: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header-left h1 {
    font-size: 32px;
    font-weight: 800;
    color: #ff6600;
}

.page-header-left p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #888;
}

.empty-state .material-icons-outlined {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 12px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ===== UI INPUT BASE ===== */
.ui-input {
    height: 40px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.ui-input:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
}
.ui-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f5f5f5;
}
.ui-input[type="date"],
.ui-input[type="datetime-local"],
.ui-input[type="time"] {
    cursor: pointer;
    min-height: 40px;
}
/* Mobile: larger touch targets, 16px font prevents iOS zoom on focus */
@media (max-width: 768px) {
    .ui-input {
        font-size: 16px;
        min-height: 46px;
        padding: 10px 12px;
    }
    .ui-input[type="date"],
    .ui-input[type="datetime-local"],
    .ui-input[type="time"] {
        min-height: 46px;
        font-size: 16px;
        padding: 10px 12px;
    }
}

/* ===== SEARCH FORM ROW ===== */
.search-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    max-width: 700px;
    align-items: center;
}
.search-form-row .search-pill {
    flex: 1;
    min-width: 180px;
}
.search-form-row .form-control {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 24px;
}

/* ===== MOBILE CARD VIEW FOR DATA TABLES ===== */
@media (max-width: 768px) {
    .data-table-wrap {
        border: none;
        background: none;
        box-shadow: none;
    }
    .data-table-wrap .data-table {
        min-width: 0;
        border: none;
        background: none;
    }
    .data-table-wrap .data-table thead {
        display: none;
    }
    .data-table-wrap .data-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 14px;
        padding: 14px 12px;
        margin-bottom: 10px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    .data-table-wrap .data-table tbody td {
        display: flex;
        align-items: center;
        gap: 6px;
        border: none;
        padding: 0;
        background: none;
        font-size: 13px;
    }
    /* Title / name cell claims its own row */
    .data-table-wrap .data-table tbody td:first-child {
        flex: 1 1 100%;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        flex-wrap: wrap;
    }
    /* Actions cell pinned to its own row */
    .data-table-wrap .data-table tbody td:last-child {
        flex: 1 1 100%;
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
        flex-wrap: wrap;
        gap: 6px;
    }
    /* Column labels from data-label attribute (set via JS in layout) */
    .data-table-wrap .data-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #9ca3af;
        margin-right: 4px;
        flex-shrink: 0;
    }
    /* No redundant labels on the title row or the actions row */
    .data-table-wrap .data-table tbody td:first-child::before,
    .data-table-wrap .data-table tbody td:last-child::before {
        content: none;
    }
    /* Avatar-first tables: keep the photo inline instead of on its own row */
    .data-table-wrap .data-table.mobile-avatar tbody td:first-child {
        flex: 0 0 auto;
        font-weight: 500;
    }
    .data-table-wrap .data-table.mobile-avatar tbody td:nth-child(2) {
        font-size: 11px;
        color: #999;
    }
}

/* ===== TASK LIST (responsive card grid) ===== */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.task-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(130px, 1.2fr) minmax(90px, .8fr) minmax(110px, .9fr) minmax(120px, 1fr) minmax(100px, .9fr) 84px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.task-row:hover {
    border-color: #ff6600;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.08);
}
.task-header-row {
    background: #f7f7f7;
    border: 1px solid #eee;
    padding: 10px 16px;
}
.task-header-row .task-cell {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #888;
}
.task-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.cell-label {
    display: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #9ca3af;
}
.cell-value {
    min-width: 0;
}
.task-cell-title .cell-value a {
    word-break: break-word;
}
.task-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.4;
    word-break: break-word;
}
.assigned-value {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 13px;
}
.assigned-value .material-icons-outlined {
    font-size: 15px;
    color: #888;
    flex-shrink: 0;
}
.task-cell-actions {
    align-items: flex-end;
}
.task-cell-actions .btn {
    width: auto;
}
.view-label {
    display: none;
}
.task-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1024px) {
    .task-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    .task-header-row {
        display: none;
    }
    .task-cell-title {
        grid-column: 1 / -1;
    }
    .task-cell-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        margin-top: 4px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    .cell-label {
        display: block;
    }
    .view-label {
        display: inline;
    }
}

@media (max-width: 600px) {
    .task-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .task-cell-actions {
        justify-content: stretch;
    }
    .task-cell-actions .btn {
        flex: 1;
    }
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.filter-btn .material-icons-outlined {
    font-size: 16px;
}

/* ===== CASE LIST (responsive card grid) ===== */
.case-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.case-row {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(140px, 1.15fr) minmax(135px, 1fr) minmax(120px, 1fr) minmax(90px, .8fr) minmax(115px, .85fr) 84px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.case-row:hover {
    border-color: #ff6600;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.08);
}
.case-header-row {
    background: #f7f7f7;
    border: 1px solid #eee;
    padding: 10px 16px;
}
.case-header-row .case-cell {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #888;
}
.case-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.case-cell-title .cell-value a {
    word-break: break-word;
}
.case-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.4;
    word-break: break-word;
}
.case-number {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.case-cell-actions {
    align-items: flex-end;
}
.case-cell-actions .btn {
    width: auto;
}
.case-overdue {
    font-size: 11px;
    color: #dc2626;
    font-weight: 600;
    margin-top: 2px;
}

/* ===== CASE DETAIL PAGE ===== */
.case-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

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

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

@media (max-width: 1024px) {
    .case-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    .case-header-row {
        display: none;
    }
    .case-cell-title {
        grid-column: 1 / -1;
    }
    .case-cell-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        margin-top: 4px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    .case-row .cell-label {
        display: block;
    }
    .case-row .view-label {
        display: inline;
    }
    .case-detail-grid {
        grid-template-columns: 1fr;
    }
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .case-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .case-cell-actions {
        justify-content: stretch;
    }
    .case-cell-actions .btn {
        flex: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .bio-grid {
        grid-template-columns: 1fr 1fr;
    }
    .split-profile-text {
        grid-template-columns: 1fr 1fr;
    }
    .split-folder-preview {
        grid-template-columns: 1fr;
    }
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .middle-section {
        grid-template-columns: 1fr 240px;
    }
    .right-panels {
        display: none;
    }
    .bottom-section {
        grid-template-columns: 1fr;
    }
    .stats-bottom-wrap {
        flex-direction: row;
    }
    .stat-box {
        flex: 1;
    }
}

@media (max-width: 1024px) {
    .split-2,
    .split-3,
    .split-list-preview,
    .split-person-statement,
    .split-profile-text,
    .text-two-col {
        grid-template-columns: 1fr;
    }
    .search-result-item {
        grid-template-columns: 40px 1fr;
        gap: 8px;
    }
    .search-result-item .muted {
        display: none;
    }
    .middle-section {
        grid-template-columns: 1fr;
    }
    .right-panels {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .right-panel {
        flex: 1;
        min-width: 150px;
    }
    .stats-bottom-wrap {
        flex-direction: row;
    }
    .stat-box {
        flex: 1;
    }
    .recent-cases-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .check-row {
        grid-template-columns: 1fr 120px 50px;
    }
    .report-grid {
        grid-template-columns: 1fr 1fr;
    }
    .report-grid .court-dates {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .hamburger {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 70px;
    }
    .top-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .top-bar h1 {
        font-size: 22px;
    }
    .section-title {
        font-size: 22px;
    }
    .toolbar {
        gap: 10px;
    }
    .toolbar-between {
        justify-content: flex-start;
    }
    .search-form-row {
        max-width: none;
    }
    .search-form-row .form-control {
        flex: 1 1 calc(50% - 4px);
        min-width: 100px;
        border-radius: 8px;
    }
    .search-form-row .btn {
        width: 100%;
    }
    .bio-grid {
        grid-template-columns: 1fr;
    }
    .folder-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card .stat-value {
        font-size: 24px;
    }
    .stat-card .stat-label {
        font-size: 11px;
    }
    .middle-section {
        grid-template-columns: 1fr;
    }
    .right-panels {
        flex-direction: column;
    }
    .bottom-section {
        grid-template-columns: 1fr;
    }
    .recent-cases-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .check-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .check-row > *:last-child {
        justify-content: flex-start;
    }
    .fingerprint-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .doc-preview {
        padding: 16px;
        min-height: auto;
    }
    .search-hero {
        padding: 24px 16px;
        min-height: auto;
    }
    .page-card {
        padding: 16px;
    }
    .page-card-header {
        padding: 16px;
    }
    .page-card-header .page-card-title {
        font-size: 16px;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .page-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .page-header-actions {
        width: 100%;
    }
    .page-header-actions .btn {
        flex: 1;
    }
    .profile-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    .profile-avatar {
        align-self: center;
    }
    .profile-main {
        text-align: center;
    }
    .profile-meta,
    .profile-tags {
        justify-content: center;
    }
    .profile-contact {
        min-width: 0;
    }
    .report-grid {
        grid-template-columns: 1fr;
    }
    .report-grid .court-dates {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 14px 10px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .top-bar h1 {
        font-size: 20px;
    }
    .top-bar-icons .icon-btn {
        width: 36px;
        height: 36px;
    }
    .cases-today-header .count {
        font-size: 28px;
    }
    .stats-bottom-wrap {
        flex-direction: column;
    }
    .fingerprint-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-form-row .form-control {
        flex: 1 1 100%;
    }
    .info-row {
        flex-direction: column;
    }
    .info-row .info-line {
        min-width: 0;
    }
    .btn-group-mobile {
        flex-direction: column;
    }
    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* ===== AUTO-RESPONSIVE GRIDS ===== */
/* Stat-card / summary rows: auto-collapse without media queries */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.grid-auto.tight {
    gap: 12px;
}
.grid-2.tight,
.grid-3.tight,
.grid-4.tight {
    gap: 12px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}
/* Form grids (multi-col forms that stack on small screens) */
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
/* Generic detail layout: main content + fixed sidebar, stacks on tablet */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .grid-1-2 {
        grid-template-columns: 1fr;
    }
}

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

/* ===== CRIMINAL PROFILE (RECORDS) ===== */
.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr 1.2fr;
    gap: 24px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    align-items: center;
}
.profile-avatar {
    position: relative;
    width: 150px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #ff6600;
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.22);
    flex-shrink: 0;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    background: #f0f0f0;
}
.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6600, #d94f00);
}
.avatar-fallback::after {
    content: "NO PHOTO";
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 700;
    opacity: 0.85;
}
.profile-main {
    min-width: 0;
}
.profile-main h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #1a1a1a;
    margin-bottom: 6px;
}
.cnum {
    display: inline-block;
    font-family: 'Roboto Mono', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    color: #888;
    font-size: 13px;
    margin-bottom: 14px;
}
.profile-meta .material-icons-outlined {
    font-size: 15px;
    vertical-align: -2px;
    color: #bbb;
    margin-right: 3px;
}
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.profile-tags .badge {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.profile-contact {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    align-content: start;
    padding-left: 24px;
    border-left: 1px solid #eee;
}
.profile-contact .info-line-full {
    grid-column: 1 / -1;
}
.profile-contact .info-line {
    min-width: 0;
}
.profile-contact .info-value-ellipsis {
    max-width: 100%;
}

.bio-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.bio-card .bio-title {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.bio-title .material-icons-outlined {
    font-size: 18px;
    color: #ff6600;
}
.info-stack {
    gap: 10px;
}
.info-line .info-label {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.info-line .info-value {
    font-size: 13.5px;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.45;
}

.biometric-item {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 10px 12px;
    align-items: flex-start;
}
.biometric-item .material-icons-outlined {
    color: #ff6600;
    font-size: 22px;
    margin-top: 1px;
}
.biometric-item .mp-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 12.5px;
}
.biometric-item .mp-role {
    color: #888;
    font-size: 11.5px;
}

.crime-list-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.crime-list-card .crime-list-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}
.crime-entry {
    padding: 12px 2px;
    border-bottom: 1px solid #f4f4f4;
}
.crime-entry:last-child {
    border-bottom: 0;
}
.crime-entry .crime-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 3px;
}
.crime-entry .crime-name.orange,
.crime-entry .crime-name:first-child {
    color: #ff6600;
}
.crime-entry .crime-meta {
    color: #777;
    font-size: 12.5px;
    margin-top: 6px;
}
.crime-entry .crime-meta.highlight-box {
    background: #fff7f0;
    border: 1px solid #ffe4cf;
    border-radius: 10px;
    padding: 8px 12px;
}

.mini-person .dot {
    width: 36px;
    height: 36px;
    background: #fff0e5;
    color: #ff6600;
    border: 1px solid #ffdcc0;
}
.mini-person .mp-role {
    background: #f7f7f7;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-block;
    margin-top: 2px;
}
.mini-person .mp-name {
    font-weight: 600;
    color: #1a1a1a;
}

.kpi-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.kpi-card .kpi-label {
    font-size: 11px;
    color: #999;
}
.kpi-card .kpi-value {
    font-size: 30px;
    color: #ff6600;
}
.court-dates {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}
.court-date-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
}
.court-date-item .material-icons-outlined {
    color: #ff6600;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.court-date-item .cd-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}
.court-date-item .cd-sub {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

@media (max-width: 1024px) {
    .profile-hero {
        grid-template-columns: auto 1fr;
    }
    .profile-contact {
        grid-column: 1 / -1;
        padding-left: 0;
        border-left: 0;
        padding-top: 16px;
        border-top: 1px solid #eee;
    }
    .bio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 18px;
        gap: 16px;
    }
    .profile-avatar {
        justify-self: center;
    }
    .profile-main {
        text-align: center;
    }
    .profile-meta,
    .profile-tags {
        justify-content: center;
    }
    .profile-contact {
        grid-template-columns: 1fr;
        text-align: left;
        padding-top: 14px;
    }
    .bio-grid {
        grid-template-columns: 1fr;
    }
    .report-grid {
        grid-template-columns: 1fr;
    }
    .report-grid .court-dates {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .profile-avatar {
        width: 130px;
    }
}
