:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --brand-red: #ee3d43;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --hover-bg: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #475569;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #1e293b;
    --dark: #f8fafc;
    --gray: #64748b;
    --border: #334155;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --hover-bg: #2d3748;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .dashboard-title h2,
[data-theme="dark"] .section-title {
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}

header {
    background: var(--brand-red);
    color: white;
    padding: 0.8rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

header .header-content.container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    background: white;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--brand-red);
    font-size: 1.1rem;
    padding: 6px;
    margin-top: 6px;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.7rem;
    font-weight: 700;
}

.logo-text p {
    font-size: 1rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.date-display {
    color: white;
    font-weight: 500;
    font-size: 1.05rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
}

.calendar-selector {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.calendar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Period Selector Segmented Control */
.period-selector label {
    line-height: 32px;
    font-size: 0.85rem;
}

#period-year:checked ~ .selection-slider {
    transform: translateX(100%);
}

/* Type Selector Segmented Control */
.type-selector {
    display: flex;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
}

.segmented-control {
    display: flex;
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 30px;
    padding: 2px;
    width: 240px;
    height: 45px;
}

.segmented-control input {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    line-height: 38px;
    cursor: pointer;
    z-index: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.segmented-control input:checked + label {
    color: white;
}

.selection-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: var(--brand-red);
    border-radius: 28px;
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

#type-crisis:checked ~ .selection-slider {
    transform: translateX(100%);
}

.period-selector {
    width: 200px;
    height: 38px;
    margin-bottom: 0.25rem;
}

.period-selector label {
    line-height: 30px;
    font-size: 0.8rem;
}

#period-year:checked ~ .selection-slider {
    transform: translateX(100%);
}

/* 
.segmented-control.main-type-selector {
    width: 360px;
}

.segmented-control.main-type-selector .selection-slider {
    width: calc(33.33% - 2px);
}

#type-action:checked ~ .selection-slider {
    transform: translateX(200%);
}
*/

#tab-items:checked ~ .remarks-actions-slider {
    transform: translateX(100%);
}

.calendar-input {
    height: 45px;
    padding: 0 1rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 154px;
    text-align: center;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 260px;
}

.period-selector {
    width: 260px;
    height: 38px;
    margin-bottom: 0.25rem;
}

.formatted-date-container {
    display: flex;
    align-items: center;
}

.calendar-nav-btn {
    background: var(--card-bg);
    border: 2px solid var(--border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    transition: var(--transition);
}

.calendar-nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--hover-bg);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-input:hover {
    border-color: var(--primary);
}

.calendar-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dashboard-title h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-red);
}

.section-title {
    margin: 1rem 0 0.75rem;
    font-size: 1.5rem;
    color: var(--brand-red);
    font-weight: 800;
}

.dashboard-title p {
    color: var(--text-muted);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--primary);
    cursor: pointer;
    user-select: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-card.active {
    background: var(--hover-bg);
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--primary);
}

.stat-card.open.active {
    border-bottom-color: var(--warning);
}

.stat-card.closed.active {
    border-bottom-color: var(--success);
}

.stat-card.delayed {
    border-top-color: var(--danger);
}

.stat-card.on-track {
    border-top-color: var(--primary);
}

.stat-card.open {
    border-top-color: var(--warning);
}

.stat-card.closed {
    border-top-color: var(--success);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0.1rem 0;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stat-trend {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.btn {
    height: 45px;
    padding: 0 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--primary);
    color: white;
}

.btn-success:hover {
    filter: brightness(0.9);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.duration-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.duration-part {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.duration-part label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-now {
    height: 45px;
    padding: 0 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-now:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.08);
}

#columns-btn, #view-mode-btn, #regularize-btn, #import-btn {
    width: 45px;
    height: 45px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    background: var(--card-bg);
    transition: var(--transition);
}

#columns-btn:hover, #view-mode-btn:hover, #regularize-btn:hover, #import-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--hover-bg);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.row-limit-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.row-limit-box select {
    padding: 0.4rem 0.8rem;
    width: auto;
    font-weight: 600;
    border: 2px solid var(--border);
}

.table-container {
    background: var(--card-bg);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow);
    overflow: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    position: relative;
}

/* Hide rows beyond the limit count using nth-child selectors */
.table-container.limit-2 tbody tr:nth-child(n+3) { display: none; }
.table-container.limit-4 tbody tr:nth-child(n+5) { display: none; }
.table-container.limit-6 tbody tr:nth-child(n+7) { display: none; }
.table-container.limit-8 tbody tr:nth-child(n+9) { display: none; }
.table-container.limit-10 tbody tr:nth-child(n+11) { display: none; }

/* Stealthy Scrollbar for Table Container */
.table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox Support */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

[data-theme="dark"] .table-container {
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Pagination Container */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: var(--hover-bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    margin: 0.5rem auto 1rem;
    width: fit-content;
}

.pagination-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1000px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--brand-red);
    color: white;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
    cursor: default;
    user-select: none;
    transition: background-color 0.2s;
}

thead th[data-column="1"],
thead th[data-column="8"],
thead th[data-column="10"],
thead th[data-column="11"],
thead th[data-column="13"] {
    cursor: pointer;
}

thead th[data-column="1"]:hover,
thead th[data-column="8"]:hover,
thead th[data-column="10"]:hover,
thead th[data-column="11"]:hover,
thead th[data-column="13"]:hover {
    background-color: #d12d33;
}

thead th.sort-asc::after {
    content: " ↑";
    font-size: 0.8rem;
}

thead th.sort-desc::after {
    content: " ↓";
    font-size: 0.8rem;
}

th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

tbody tr:hover {
    background-color: var(--hover-bg);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
}

.status {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-closed {
    color: var(--success);
}

.status-open {
    color: var(--warning);
}

.hide-row-icon {
    cursor: pointer;
    opacity: 0.4;
    transition: var(--transition);
    color: var(--text-muted);
}

.hide-row-icon:hover {
    opacity: 1;
    color: var(--danger);
    transform: scale(1.1);
}

.age-column {
    text-align: center;
}

.age-column.urgent {
    color: var(--warning);
    font-weight: bold;
}

.aging {
    font-weight: 600;
}

.aging.urgent {
    color: var(--danger);
}

.aging.warning {
    color: var(--warning);
}

.detail-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.incident-details {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
}

.detail-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.detail-title-row h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--brand-red);
}

[data-theme="dark"] .detail-title-row h3 {
    color: white;
}

[data-theme="dark"] .detail-title-row h3 .editable-value {
    color: white;
}

/* Simple Status Toggle */
.status-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch.small {
    width: 36px;
    height: 18px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--brand-red); /* Open color - Red */
    transition: .4s;
    border-radius: 24px;
}

.switch.small .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary); /* Closed color - Blue */
}

.status-toggle-container .switch input:checked + .slider {
    background-color: var(--success); /* Green for upper toggle */
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.switch.small input:checked + .slider:before {
    transform: translateX(18px);
}

.remark-entry.closed {
    border-left-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

[data-theme="dark"] .remark-entry.closed {
    background: rgba(37, 99, 235, 0.1);
}

.remark-entry.closed .remark-text {
    text-decoration: line-through;
    opacity: 0.7;
}

.remark-entry.closed .remark-date,
.remark-entry.closed .remark-assignee {
    color: var(--primary);
    opacity: 0.7;
}

.action-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.3rem;
}

.action-toggle-row strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    min-width: 50px;
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.95rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.edit-icon {
    cursor: pointer;
    margin-left: 6px;
    font-size: 0.9rem;
    color: var(--primary);
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.edit-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.editable-value {
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}

.editable-value:hover {
    border-bottom-color: var(--primary);
    cursor: pointer;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-item {
    width: 100%;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-value {
    font-size: 1.1rem;
    color: var(--text-main);
    padding: 0.25rem 0;
    width: 100%;
}

.history-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    align-self: start;
    position: sticky;
    top: 2rem;
    border: 1px solid var(--border);
}

.history-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-main);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    position: relative;
    padding-left: 22px;
}

.history-item:before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
}

.history-item:first-child:before {
    background: var(--primary);
}

.history-date {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.history-content {
    background: var(--hover-bg);
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    border-left: 2px solid var(--primary);
    color: var(--text-main);
}

/* New Remarks Styles */
.remarks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 3% auto;
    padding: 1.25rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideDown 0.3s ease-out;
}

.modal .incident-details {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

@keyframes modalSlideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.modal-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--hover-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--brand-red);
    font-weight: 700;
}

[data-theme="dark"] .modal-header h3 {
    color: white;
}

.modal-header .close-modal {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.modal-header .close-modal:hover {
    color: var(--danger);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.remark-entry {
    background: rgba(245, 158, 11, 0.05);
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
}

[data-theme="dark"] .remark-entry {
    background: rgba(245, 158, 11, 0.1);
}

.remark-items {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    transition: var(--transition);
}

.remark-items .action-toggle-row {
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remark-action-btn {
    opacity: 0;
    transition: var(--transition);
}

.remark-entry:hover .remark-action-btn {
    opacity: 1;
}

.remark-action-btn {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.remark-action-btn:hover {
    color: var(--primary);
    transform: scale(1.2);
}

.remark-action-btn.delete:hover {
    color: var(--danger);
}

.remark-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.remark-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.remark-assignee {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning);
    text-transform: uppercase;
}

.remark-assignee-name {
    color: #1e293b;
}

[data-theme="dark"] .remark-assignee-name {
    color: white;
}

.remark-text {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.description-box {
    background: rgba(245, 158, 11, 0.05);
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    margin-top: 0.25rem;
}

[data-theme="dark"] .description-box {
    background: rgba(245, 158, 11, 0.1);
}

.description-box .edit-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    opacity: 0;
    transition: var(--transition);
    color: var(--warning);
    margin: 0;
}

.description-box:hover .edit-icon {
    opacity: 1;
}

.description-box .editable-value:hover {
    border-bottom-color: var(--warning);
}

.add-remark-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Hide default spin buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

.number-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    overflow: hidden;
    transition: var(--transition);
}

.number-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.number-input-wrapper .form-control {
    border: none;
    text-align: center;
    padding: 0;
    height: 40px;
    width: 100%;
    background: transparent;
}

.number-input-wrapper .form-control:focus {
    box-shadow: none;
}

.number-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 35px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1.2rem;
    user-select: none;
}

.number-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .number-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.form-control {
    width: 100%;
    height: 45px;
    padding: 0 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 0.75rem;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row > .form-group:first-child {
    flex: 1;
}

.form-row > .form-group:last-child {
    flex: 2;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: stretch;
}

.form-row > .form-group:last-child .btn {
    flex: 1;
    white-space: nowrap;
}

footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .detail-view {
        grid-template-columns: 1fr;
    }

    .history-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .actions {
        flex-wrap: wrap;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Column Visibility Toggle Styles */
.column-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    z-index: 100;
    min-width: max-content;
    margin-top: 0.5rem;
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: column;
    gap: 0.25rem 1.5rem;
}

.column-dropdown.show {
    display: grid;
}

.column-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    border-radius: 6px;
    transition: var(--transition);
}

.column-option:hover {
    background: var(--hover-bg);
}

.column-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.col-hidden {
    display: none !important;
}

/* Export Range Box Styles */
.export-range-boxes {
    display: flex;
    gap: 1rem;
}

.export-box {
    flex: 1;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
    background: var(--card-bg);
}

.export-box:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.export-box input[type="radio"] {
    display: none;
}

.export-box input[type="radio"]:checked + .export-box-content {
    color: var(--primary);
}

.export-box:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

[data-theme="dark"] .export-box:has(input[type="radio"]:checked) {
    background: rgba(59, 130, 246, 0.1);
}

.export-box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.export-box-icon {
    font-size: 2rem;
}

.export-box-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

