:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --admin: #8e44ad;
    --staff: #16a085;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    animation: slideUp 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.login-header .logo i {
    font-size: 40px;
    color: var(--secondary);
}

.login-header .logo h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.login-header .logo span {
    color: var(--secondary);
}

.login-header p {
    color: #666;
    font-size: 16px;
}

.login-options {
    display: flex;
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.login-option {
    flex: 1;
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.login-option.active {
    background-color: var(--secondary);
    color: white;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left var(--transition-base);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.login-btn:hover::before {
    left: 100%;
}

.demo-credentials {
    margin-top: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

.demo-credentials h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.demo-credentials p {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary), #1a2530);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
    color: var(--secondary);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.logo span {
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role {
    background-color: var(--admin);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.user-role.staff {
    background-color: var(--staff);
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.3);
}

.user-role:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
}

.logout-btn {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Dashboard Styles */
.dashboard {
    padding: 30px 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(52, 152, 219, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #219653);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(39, 174, 96, 0.2);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(243, 156, 18, 0.2);
}

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

.stat-card {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideInLeft var(--transition-slow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(52, 152, 219, 0.1);
    transition: left var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
    left: 100%;
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: relative;
    z-index: 1;
    transition: all var(--transition-base);
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(5deg);
}

.stat-icon.pending {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.stat-icon.found {
    background: linear-gradient(135deg, var(--success), #219653);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.stat-icon.not-found {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.stat-icon.total {
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.stat-info h3 {
    font-size: 36px;
    margin-bottom: 5px;
    font-weight: 800;
}

.stat-info p {
    color: #666;
    font-weight: 500;
    font-size: 15px;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid #f0f0f0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    color: #666;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), #2980b9);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tab:hover {
    color: var(--secondary);
    background-color: rgba(52, 152, 219, 0.05);
}

.tab:hover::before {
    transform: scaleX(1);
}

.tab.active {
    background: linear-gradient(135deg, var(--secondary), #2980b9);
    color: white;
}

.tab.active::before {
    transform: scaleX(0);
}

/* Tab Content */
.tab-content {
    display: none;
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    display: block;
    animation: slideInRight var(--transition-slow);
}

.form-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.form-title h3 {
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
}

.search-box input {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 300px;
    font-size: 15px;
}

.client-year-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
}

.client-year-controls label {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.client-year-controls select {
    min-width: 180px;
    padding: 11px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 15px;
}

.client-year-controls select:focus {
    border-color: #168F83;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(22,143,131,.1);
}

.client-year-count {
    margin: -12px 0 14px;
    color: #71838A;
}

.client-remark-history {
    display: grid;
    gap: 12px;
    max-height: 340px;
    overflow-y: auto;
}

.client-remark-entry {
    min-width: 0;
    padding: 12px;
    border: 1px solid #DCECE8;
    border-radius: 9px;
    background: #fff;
}

.client-remark-entry-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: #263746;
}

.client-remark-entry-heading time {
    color: #71838A;
    font-size: 12px;
}

.client-remark-category {
    display: inline-block;
    margin-top: 7px;
    color: #176B65;
    font-size: 12px;
    font-weight: 600;
}

.client-remark-entry > p {
    margin: 6px 0 0;
    color: #40545C;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.client-remark-edit {
    margin-top: 10px;
    font-size: 14px;
}

.remarks-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.remarks-filters input,
.remarks-filters select {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background-color: white;
}

.remarks-filters input:focus,
.remarks-filters select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.remark-description {
    min-width: 280px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.remarks-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

.remark-row-actions {
    min-width: 100px;
}

/* Task Statistics */
.tasks-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.task-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    animation: slideInLeft var(--transition-slow);
}

.task-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.task-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.task-stat-icon.pending {
    background: linear-gradient(135deg, var(--warning), #e67e22);
}

.task-stat-icon.in-progress {
    background: linear-gradient(135deg, var(--secondary), #2980b9);
}

.task-stat-icon.completed {
    background: linear-gradient(135deg, var(--success), #219653);
}

.task-stat-info h4 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary);
}

.task-stat-info p {
    font-size: 14px;
    color: #666;
}

/* Priority Badges */
.priority-badge {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-low {
    background-color: #d4edda;
    color: #155724;
}

.priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.priority-high {
    background-color: #ffe5e5;
    color: #bd2130;
}

.priority-critical {
    background-color: #f8d7da;
    color: #721c24;
}

.status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-on-hold {
    background-color: #f0f0f0;
    color: #666;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th {
    background: linear-gradient(135deg, var(--primary), #34495e);
    color: white;
    text-align: left;
    padding: 18px;
    font-weight: 600;
    font-size: 15px;
}

table td {
    padding: 18px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

table tr {
    transition: all var(--transition-fast);
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f7fd;
    transform: scale(1.01);
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: all var(--transition-base);
    animation: slideInLeft var(--transition-slow);
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-found {
    background-color: #d4edda;
    color: #155724;
}

.status-not-found {
    background-color: #f8d7da;
    color: #721c24;
}

.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.client-actions-cell {
    vertical-align: middle;
    padding: 8px 10px;
}

#clientsTable th:last-child,
#clientsTable td.client-actions-cell {
    width: 260px;
    min-width: 260px;
}

.client-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
    align-items: center;
    justify-items: stretch;
}

.client-action-grid .action-btn {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    min-width: 0;
    padding: 6px 5px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
    gap: 5px;
}

.client-action-grid .action-btn i {
    flex: 0 0 auto;
}

.client-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.client-details-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #E4EFEC;
    border-radius: 10px;
    background: #F4F9F8;
    overflow-wrap: anywhere;
}

.client-details-item strong {
    color: #71838A;
    font-size: 11px;
    text-transform: uppercase;
}

.client-details-item span {
    color: #263746;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 480px) {
    #clientsTable th:last-child,
    #clientsTable td.client-actions-cell {
        width: 240px;
        min-width: 240px;
    }

    .client-action-grid {
        gap: 8px;
    }

    .client-action-grid .action-btn {
        padding: 6px 3px;
        font-size: 12px;
        gap: 4px;
    }
}

.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn.edit {
    background-color: #e3f2fd;
    color: var(--secondary);
}

.action-btn.edit:hover {
    background-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.action-btn.delete {
    background-color: #fdeaea;
    color: var(--danger);
}

.action-btn.delete:hover {
    background-color: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.action-btn.whatsapp {
    background-color: #e8f7ec;
    color: #25D366;
}

.action-btn.whatsapp:hover {
    background-color: #25D366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.action-btn.invoice {
    background-color: #f3e8ff;
    color: var(--admin);
}

.action-btn.invoice:hover {
    background-color: var(--admin);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.action-btn.remark {
    background-color: #fff4df;
    color: #9a6700;
}

.action-btn.remark:hover {
    background-color: #f0ad35;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 173, 53, 0.3);
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 30px;
}

.remark-client-info,
.remark-latest {
    padding: 16px 18px;
    border-radius: 8px;
    background-color: #f5f7fa;
    margin-bottom: 22px;
}

.remark-client-info p + p {
    margin-top: 6px;
}

.remark-latest h4 {
    color: var(--primary);
    margin-bottom: 8px;
}

.remark-latest p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.remark-latest small {
    display: block;
    color: #666;
    margin-top: 8px;
}

.remark-examples {
    color: #666;
    font-size: 13px;
    margin-top: -12px;
}

.remark-examples ul {
    margin: 6px 0 0 20px;
}

.remark-error {
    color: var(--danger);
    margin-top: 14px;
}

.invoice-client-preview {
    padding: 16px 18px;
    margin: 0 0 22px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background-color: #f5f7fa;
}

.invoice-client-preview p + p {
    margin-top: 6px;
}

.invoice-client-preview p:first-of-type:not(:only-child) {
    color: var(--primary);
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #eee;
}

#remarkForm .form-actions [hidden] {
    display: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

/* Reports */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.report-summary-card {
    display: flex;
    min-width: 0;
    min-height: 92px;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid #DCECE8;
    border-radius: 12px;
    background: linear-gradient(145deg, #fff, #F2FAF8);
    box-shadow: 0 4px 14px rgba(23,107,101,.05);
}

.report-summary-card span {
    color: #637A78;
    font-size: 13px;
    font-weight: 600;
}

.report-summary-card strong {
    overflow-wrap: anywhere;
    color: #176B65;
    font-size: clamp(16px, 2vw, 22px);
    line-height: 1.25;
}

.report-summary-error {
    margin: -12px 0 20px;
    color: var(--danger);
    font-size: 14px;
}

.report-remarks-panel {
    margin: 0 0 28px;
    padding: 18px;
    border: 1px solid #DCECE8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(23,107,101,.05);
}

.report-remarks-panel h4 {
    margin: 0 0 14px;
    color: #176B65;
}

.report-remarks-note {
    margin: -6px 0 14px;
    color: #637A78;
    font-size: 13px;
}

.report-remarks-table {
    min-width: 860px;
}

.report-remarks-table td,
#remarksTable td {
    vertical-align: top;
}

.report-remarks-error {
    margin: 0 0 12px;
    color: var(--danger);
}

.admin-notes-layout {
    display: grid;
    grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
    gap: 20px;
    min-height: 480px;
}

.admin-notes-sidebar,
.admin-note-editor {
    min-width: 0;
    border: 1px solid #DCECE8;
    border-radius: 12px;
    background: #fff;
}

.admin-notes-sidebar {
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.admin-notes-sidebar input,
.admin-note-editor > input,
.admin-note-editor > textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #C9E1DC;
    border-radius: 8px;
    background: #fff;
    color: #263746;
}

.admin-notes-sidebar input {
    padding: 10px 12px;
}

.admin-notes-sidebar input:focus,
.admin-note-editor > input:focus,
.admin-note-editor > textarea:focus {
    border-color: #168F83;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(22,143,131,.1);
}

.admin-notes-list-status {
    margin: 12px 2px 8px;
    color: #71838A;
    font-size: 13px;
}

.admin-notes-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 540px;
    overflow-y: auto;
}

.admin-note-list-item {
    display: grid;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #F4F9F8;
    color: #263746;
    cursor: pointer;
    text-align: left;
}

.admin-note-list-item:hover,
.admin-note-list-item.active {
    border-color: #B8DCD4;
    background: #EAF6F3;
}

.admin-note-list-item strong,
.admin-note-list-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-note-list-item span {
    color: #71838A;
    font-size: 12px;
}

.admin-notes-empty {
    padding: 12px 4px;
    color: #71838A;
    font-size: 14px;
}

.admin-note-editor {
    display: flex;
    min-height: 480px;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
}

.admin-note-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 38px;
    color: #637A78;
    font-size: 13px;
}

.admin-note-editor-header .btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.admin-note-editor > input {
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 600;
}

.admin-note-editor > textarea {
    flex: 1;
    min-height: 320px;
    padding: 14px;
    resize: vertical;
    line-height: 1.65;
}

.admin-note-editor > input:disabled,
.admin-note-editor > textarea:disabled {
    background: #F6F8F8;
    cursor: not-allowed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.remark-details {
    min-width: 120px;
    white-space: normal;
}

.remark-details summary {
    color: #176B65;
    cursor: pointer;
    font-weight: 600;
}

.remark-details p {
    margin: 8px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.report-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.report-actions label {
    color: #176B65;
    font-weight: 600;
    white-space: nowrap;
}

.report-actions select {
    min-width: 150px;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #C9E1DC;
    border-radius: 8px;
    background: #fff;
    color: #263746;
}

.report-actions input[type="search"] {
    min-width: 190px;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #C9E1DC;
    border-radius: 8px;
    background: #fff;
    color: #263746;
}

.report-actions button {
    white-space: nowrap;
}

.referral-report-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.referral-report-heading h4 {
    margin-bottom: 10px;
}

.referral-report-actions {
    justify-content: flex-start;
}

.referral-summary-grid {
    margin-top: 8px;
}

.referral-year-summary {
    margin: 0 0 20px;
}

.referral-year-summary h5 {
    margin: 0 0 10px;
    color: #176B65;
    font-size: 15px;
}

.referral-details-table {
    min-width: 640px;
}

.reports-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

@media (max-width: 480px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .report-summary-card {
        min-height: 82px;
        padding: 12px;
    }
}

@media (max-width: 760px) {
    .referral-report-actions {
        width: 100%;
    }

    .referral-report-actions input[type="search"] {
        flex: 1 1 100%;
    }

    .admin-notes-layout {
        grid-template-columns: minmax(0, 1fr);
        min-height: auto;
    }

    .admin-notes-list {
        max-height: 220px;
    }

    .admin-note-editor {
        min-height: 420px;
        padding: 14px;
    }

    .admin-note-editor > textarea {
        min-height: 280px;
    }
}

.report-card {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.report-card h4 {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

#monthlyChart, #statusChart {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-weight: 600;
}

/* Advanced Animations and Effects */
* {
    scroll-behavior: smooth;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Text gradient animation */
.gradient-text {
    background: linear-gradient(90deg, var(--secondary), var(--admin), var(--success));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s linear infinite;
}

/* Focus visible for better accessibility */
:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Smooth scrolling for tables */
.table-container {
    scroll-behavior: smooth;
}

/* Enhanced form validation states */
input:valid {
    border-color: var(--success);
}

input:invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .form-title {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .report-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .report-actions select {
        flex: 1 1 100%;
    }

    .report-actions button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .client-year-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .client-year-controls .search-box {
        flex: 1 1 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .reports-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Premium mint, aqua and teal design system */
:root {
    --primary: #176B65;
    --secondary: #168F83;
    --success: #168F83;
    --warning: #65CBB8;
    --danger: #168F83;
    --light: #EAF9F5;
    --dark: #176B65;
    --admin: #176B65;
    --staff: #168F83;
    --shadow-sm: 0 2px 10px rgba(23, 107, 101, .06);
    --shadow-md: 0 6px 22px rgba(23, 107, 101, .08);
    --shadow-lg: 0 14px 34px rgba(23, 107, 101, .12);
    --transition-fast: .18s cubic-bezier(.2, .8, .2, 1);
    --transition-base: .28s cubic-bezier(.2, .8, .2, 1);
    --transition-slow: .45s cubic-bezier(.2, .8, .2, 1);
}

* { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { background: #F4F9F8; color: #263746; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(22, 143, 131, .26);
    outline-offset: 3px;
}

/* Login */
.login-container {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(135deg, #DDF5EE 0%, #BDEDE1 48%, #EAF9F5 100%);
    background-size: 180% 180%;
    animation: mint-gradient 18s ease-in-out infinite;
}
.login-container::before, .login-container::after {
    position: absolute;
    z-index: -1;
    width: min(45vw, 460px);
    aspect-ratio: 1;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(101,203,184,.32), rgba(221,245,238,.18));
    content: "";
    pointer-events: none;
    animation: mint-drift 17s ease-in-out infinite alternate;
}
.login-container::before { top: -19%; left: -10%; }
.login-container::after { right: -9%; bottom: -22%; animation-delay: -8s; }
.login-box {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 20px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 25px 70px rgba(23,107,101,.15);
    backdrop-filter: blur(16px);
    animation: mint-enter .65s cubic-bezier(.22,1,.36,1) both;
}
.login-header .logo i, .login-header .logo span { color: #168F83; }
.login-header p, .demo-credentials p { color: #71838A; }
.login-options { border-color: #E4EFEC; background: #F4F9F8; }
.login-option { transition: color var(--transition-base), background var(--transition-base), transform var(--transition-fast); }
.login-option.active { background: linear-gradient(135deg, #168F83, #176B65); }
.login-option:active { transform: scale(.985); }
.form-group label { color: #415661; }
.form-group input, .form-group select, .form-group textarea,
.remarks-filters input, .remarks-filters select {
    border-color: #E4EFEC;
    background-color: #fff;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.remarks-filters input:focus, .remarks-filters select:focus {
    border-color: #168F83;
    box-shadow: 0 0 0 4px rgba(22,143,131,.11);
    outline: 0;
    transform: translateY(-1px);
}
input:invalid:focus, select:invalid:focus, textarea:invalid:focus {
    border-color: #168F83;
    box-shadow: 0 0 0 4px rgba(22,143,131,.11);
}
.login-btn {
    background: linear-gradient(120deg, #168F83, #176B65, #168F83);
    background-size: 180% 100%;
    box-shadow: 0 6px 16px rgba(22,143,131,.18);
    transition: background-position var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}
.login-btn:hover { background-position: 100% 0; box-shadow: 0 10px 24px rgba(22,143,131,.25); }
.login-btn:active, .btn:active, .logout-btn:active, .action-btn:active { transform: translateY(1px) scale(.98); }
.demo-credentials { border-left-color: #65CBB8; background: #EAF9F5; }
.demo-credentials h4 { color: #176B65; }

/* Header and dashboard shell */
header {
    background: linear-gradient(115deg, #181818, #303030 68%, #181818);
    box-shadow: 0 4px 18px rgba(0,0,0,.16);
    border-bottom: 3px solid #C4161C;
}
header::before { animation-duration: 6s; }
.brand-logo {
    min-width: 0;
    gap: 12px;
}
.brand-logo-image {
    display: block;
    width: 104px;
    max-width: 26vw;
    max-height: 70px;
    height: auto;
    flex: 0 1 auto;
    object-fit: contain;
    border-radius: 5px;
    background: #fff;
}
.brand-copy {
    min-width: 0;
}
.brand-copy h1 {
    color: #fff;
    font-size: clamp(15px, 1.7vw, 21px);
    line-height: 1.2;
}
.brand-copy p {
    margin-top: 3px;
    color: #eee;
    font-size: 12px;
    line-height: 1.2;
}
.login-header .brand-logo {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.login-header .brand-logo-image {
    width: min(250px, 100%);
    max-width: 100%;
    max-height: 167px;
}
.login-header p {
    color: #71838A;
}
.user-role, .user-role.staff {
    background: rgba(101,203,184,.2);
    box-shadow: inset 0 0 0 1px rgba(189,237,225,.2);
}
.user-role:hover { box-shadow: inset 0 0 0 1px rgba(189,237,225,.35); }
.logout-btn { background: rgba(255,255,255,.14); }
.logout-btn:hover { background: rgba(255,255,255,.23); box-shadow: 0 6px 16px rgba(13,71,66,.18); }

#dashboard .dashboard.container {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas:
        "sidebar heading"
        "sidebar stats"
        "sidebar content";
    grid-template-rows: auto auto minmax(0, 1fr);
    align-items: start;
    gap: 0 24px;
    width: min(100% - 40px, 1500px);
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px 0 42px;
    animation: mint-enter .52s cubic-bezier(.22,1,.36,1) both;
}
.dashboard-header {
    grid-area: heading;
    min-width: 0;
    animation: mint-fade .4s ease both;
}
.dashboard-header h2 { min-width: 0; }
.stats-container { grid-area: stats; min-width: 0; }
.tab-content { grid-area: content; min-width: 0; }
.dashboard-header h2, .form-title h3 { color: #263746; }
.btn-primary, .btn-success, .btn-warning {
    border: 0;
    background: linear-gradient(135deg, #168F83, #176B65);
    box-shadow: 0 5px 13px rgba(22,143,131,.14);
    transition: transform var(--transition-fast), box-shadow var(--transition-base), filter var(--transition-base);
}
.btn-primary:hover, .btn-success:hover, .btn-warning:hover {
    filter: brightness(1.05);
    box-shadow: 0 9px 20px rgba(22,143,131,.2);
    transform: translateY(-2px);
}
.btn-secondary { background: #71838A; }
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .62; box-shadow: none; transform: none; }
button:disabled::after {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    vertical-align: -2px;
    animation: spin .75s linear infinite;
}

/* Sidebar navigation uses the existing tab controls and preserves their behavior. */
.tabs {
    position: sticky;
    z-index: 2;
    top: 20px;
    grid-area: sidebar;
    align-self: stretch;
    display: flex;
    width: 100%;
    height: calc(100vh - 40px);
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    margin: 0;
    padding: 14px 11px;
    overflow: auto;
    border: 1px solid #E4EFEC;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(23,107,101,.07);
    transition: width var(--transition-base), transform var(--transition-base);
}
.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 3px 7px 12px;
    padding: 0 5px 14px;
    border-bottom: 1px solid #E4EFEC;
    color: #71838A;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.sidebar-collapse-toggle {
    display: none;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: #EAF9F5;
    color: #176B65;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-base);
}
.sidebar-collapse-toggle:hover { background: #DDF5EE; }
.sidebar-collapse-toggle i { transition: transform var(--transition-base); }
.mobile-nav-toggle { display: none; }
.mobile-nav-close { display: none; }
.sidebar-heading-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: #EAF9F5;
    color: #168F83;
    font-size: 13px;
}
.tab {
    position: relative;
    display: flex;
    min-height: 46px;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    overflow: hidden;
    border-radius: 10px;
    color: #71838A;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    transition: color var(--transition-base), background var(--transition-base), transform var(--transition-fast);
}
.tab i { width: 18px; color: #87a19f; text-align: center; transition: transform var(--transition-base), color var(--transition-base); }
.tab::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    height: auto;
    border-radius: 0 4px 4px 0;
    background: #168F83;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform var(--transition-base);
}
.tab::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #EAF9F5;
    content: "";
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}
.tab:hover { color: #176B65; background: #F4F9F8; }
.tab:hover i { color: #168F83; transform: translateY(-1px); }
.tab.active { background: #EAF9F5; color: #176B65; }
.tab.active::before { transform: scaleY(1); }
.tab.active i { color: #168F83; }

/* Mint statistic cards */
.stats-container { gap: 18px; margin-bottom: 24px; }
.stat-card {
    --entrance-delay: 0ms;
    border: 1px solid #E4EFEC;
    border-radius: 15px;
    background: linear-gradient(145deg, #fff 58%, #F4FBF9);
    box-shadow: 0 5px 18px rgba(23,107,101,.055);
    animation: mint-enter .55s cubic-bezier(.22,1,.36,1) both;
    animation-delay: var(--entrance-delay);
}
.stat-card:nth-child(1) { --entrance-delay: 40ms; }
.stat-card:nth-child(2) { --entrance-delay: 100ms; }
.stat-card:nth-child(3) { --entrance-delay: 160ms; }
.stat-card:nth-child(4) { --entrance-delay: 220ms; }
.stat-card:hover { box-shadow: 0 12px 26px rgba(23,107,101,.11); transform: translateY(-4px); }
.stat-card::before { background: linear-gradient(110deg, transparent, rgba(189,237,225,.42), transparent); }
.stat-icon.total { background: linear-gradient(135deg, #168F83, #65CBB8); box-shadow: 0 5px 13px rgba(22,143,131,.16); }
.stat-icon.pending { background: linear-gradient(135deg, #65CBB8, #168F83); box-shadow: 0 5px 13px rgba(22,143,131,.14); }
.stat-icon.found { background: linear-gradient(135deg, #BDEDE1, #65CBB8); color: #176B65; box-shadow: 0 5px 13px rgba(101,203,184,.18); }
.stat-icon.not-found { background: linear-gradient(135deg, #DDF5EE, #BDEDE1); color: #176B65; box-shadow: 0 5px 13px rgba(101,203,184,.14); }
.stat-card:hover .stat-icon { transform: scale(1.07) rotate(2deg); }
.stat-info h3 { color: #263746; font-variant-numeric: tabular-nums; }
.stat-info p { color: #71838A; }
.tasks-stats { gap: 17px; }
.task-stat-card {
    border: 1px solid #E4EFEC;
    box-shadow: 0 5px 18px rgba(23,107,101,.06);
}
.task-stat-card:hover { box-shadow: 0 11px 26px rgba(23,107,101,.11); }
.task-stat-icon.pending, .task-stat-icon.in-progress, .task-stat-icon.completed {
    background: linear-gradient(135deg, #168F83, #65CBB8);
}

/* Content cards, data tables and badges */
.tab-content {
    border: 1px solid #E4EFEC;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(23,107,101,.06);
}
.tab-content.active { animation: mint-tab-enter .32s cubic-bezier(.22,1,.36,1) both; }
.form-title { border-bottom-color: #E4EFEC; }
.search-box input { border-color: #E4EFEC; border-radius: 10px; transition: border-color var(--transition-base), box-shadow var(--transition-base); }
.search-box input:focus { border-color: #168F83; outline: 0; box-shadow: 0 0 0 4px rgba(22,143,131,.1); }
.table-container { border-color: #E4EFEC; border-radius: 12px; box-shadow: 0 4px 14px rgba(23,107,101,.035); }
table { margin-top: 0; }
table th { background: linear-gradient(110deg, #176B65, #168F83); }
table td { border-bottom-color: #EAF2F0; color: #425560; }
table tbody tr {
    position: relative;
    animation: mint-row-enter .34s cubic-bezier(.22,1,.36,1) both;
    transition: background-color var(--transition-fast);
}
table tbody tr:nth-child(1) { animation-delay: 20ms; }
table tbody tr:nth-child(2) { animation-delay: 50ms; }
table tbody tr:nth-child(3) { animation-delay: 80ms; }
table tbody tr:nth-child(4) { animation-delay: 110ms; }
table tbody tr:nth-child(5) { animation-delay: 140ms; }
table tbody tr:hover { background: #EAF9F5; transform: none; }
table tr:nth-child(even) { background-color: #FBFDFC; }
.status-badge, .priority-badge {
    border: 1px solid rgba(22,143,131,.08);
    transition: background-color var(--transition-base), color var(--transition-base), transform var(--transition-fast);
}
.status-pending, .priority-medium { background: #EAF9F5; color: #176B65; }
.status-found, .priority-low { background: #DDF5EE; color: #176B65; }
.status-not-found, .priority-high, .priority-critical { background: #BDEDE1; color: #176B65; }
.status-in-progress, .status-on-hold { background: #EAF9F5; color: #176B65; }
.action-btn { transition: transform var(--transition-fast), box-shadow var(--transition-base), background-color var(--transition-base), color var(--transition-base); }
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(23,107,101,.11); }
.action-btn.edit, .action-btn.delete, .action-btn.whatsapp, .action-btn.invoice, .action-btn.remark {
    background: #EAF9F5;
    color: #176B65;
}
.action-btn.edit:hover, .action-btn.delete:hover, .action-btn.whatsapp:hover,
.action-btn.invoice:hover, .action-btn.remark:hover {
    background: #168F83;
    color: #fff;
}
.priority-low, .priority-medium, .priority-high, .priority-critical { text-transform: uppercase; }

/* Dialogs, charts and data visualization */
.modal { background: rgba(23,58,56,.42); backdrop-filter: blur(5px); }
.modal.is-closing { opacity: 0; transition: opacity .2s ease; }
.modal-content {
    border: 1px solid #E4EFEC;
    border-radius: 16px;
    box-shadow: 0 22px 65px rgba(23,70,66,.2);
    animation: mint-modal-enter .28s cubic-bezier(.22,1,.36,1) both;
    transition: opacity .2s ease, transform .2s ease;
}
.modal.is-closing .modal-content { opacity: 0; transform: translateY(8px) scale(.97); }
.modal-header, .form-actions { border-color: #E4EFEC; }
.modal-header h3, .remark-latest h4 { color: #176B65; }
.close { display: inline-grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; transition: color var(--transition-base), background var(--transition-base), transform var(--transition-base); }
.close:hover { color: #176B65; background: #EAF9F5; transform: rotate(90deg); }
.remark-client-info, .remark-latest, .invoice-client-preview { border: 1px solid #E4EFEC; background: #F4F9F8; }
.remark-latest small, .remark-examples { color: #71838A; }
.reports-container { gap: 22px; }
.report-card { border: 1px solid #E4EFEC; border-radius: 15px; box-shadow: 0 5px 18px rgba(23,107,101,.055); transition: transform var(--transition-base), box-shadow var(--transition-base); }
.report-card:hover { box-shadow: 0 11px 25px rgba(23,107,101,.1); transform: translateY(-2px); }
.report-card h4 { color: #176B65; }
#monthlyChart, #statusChart { border: 1px solid #E4EFEC; background: linear-gradient(145deg, #F4F9F8, #EAF9F5); }
#monthlyChart .chart-bar {
    transform: scaleY(0);
    transform-origin: bottom;
    animation: mint-chart-grow .8s cubic-bezier(.22,1,.36,1) .1s both;
    transition: filter var(--transition-fast);
}
#monthlyChart .chart-bar:hover { filter: brightness(1.06); }
#statusChart .chart-progress {
    width: 0;
    border-radius: inherit;
    animation: mint-chart-fill .75s cubic-bezier(.22,1,.36,1) .12s both;
}

@keyframes mint-enter { from { opacity: 0; transform: translate3d(0,14px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes mint-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mint-tab-enter { from { opacity: 0; transform: translate3d(0,7px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes mint-row-enter { from { opacity: 0; transform: translate3d(0,6px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes mint-modal-enter { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes mint-chart-grow { to { transform: scaleY(1); } }
@keyframes mint-chart-fill { to { width: var(--chart-width); } }
@keyframes mint-gradient { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes mint-drift { from { transform: translate3d(-12px,8px,0) scale(.96); } to { transform: translate3d(22px,-18px,0) scale(1.04); } }

@media (max-width: 1024px) and (min-width: 769px) {
    #dashboard .dashboard.container {
        grid-template-columns: 224px minmax(0, 1fr);
        gap: 0 18px;
        width: calc(100% - 32px);
    }
    .sidebar-collapse-toggle { display: inline-flex; }
    #dashboard.sidebar-collapsed .dashboard.container {
        grid-template-columns: 76px minmax(0, 1fr);
    }
    #dashboard.sidebar-collapsed .tabs { padding-right: 8px; padding-left: 8px; }
    #dashboard.sidebar-collapsed .sidebar-heading {
        justify-content: center;
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }
    #dashboard.sidebar-collapsed .sidebar-heading > span:last-of-type,
    #dashboard.sidebar-collapsed .tab > span { display: none; }
    #dashboard.sidebar-collapsed .sidebar-collapse-toggle { margin: 9px auto 0; }
    #dashboard.sidebar-collapsed .sidebar-collapse-toggle i { transform: rotate(180deg); }
    #dashboard.sidebar-collapsed .tab { justify-content: center; padding-right: 8px; padding-left: 8px; }
    #dashboard.sidebar-collapsed .tab i { width: auto; }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 12px;
    }
    .brand-logo-image {
        width: 78px;
        max-height: 52px;
    }
    .user-info {
        gap: 9px;
    }
    #dashboard .dashboard.container {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "heading"
            "stats"
            "content";
        grid-template-rows: auto auto minmax(0, 1fr);
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 22px 16px 36px;
        animation: none;
    }
    .dashboard-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    .dashboard-header h2 { flex: 1; }
    .mobile-nav-toggle {
        position: relative;
        z-index: 1002;
        display: inline-flex;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid #E4EFEC;
        border-radius: 11px;
        background: #fff;
        color: #176B65;
        box-shadow: 0 3px 10px rgba(23,107,101,.06);
        cursor: pointer;
    }
    .tabs {
        position: fixed;
        z-index: 1003;
        top: 0;
        bottom: 0;
        left: 0;
        grid-area: auto;
        align-self: auto;
        width: min(82vw, 290px);
        height: 100dvh;
        gap: 6px;
        margin: 0;
        padding: 22px 13px;
        overflow-y: auto;
        border: 0;
        border-radius: 0 18px 18px 0;
        box-shadow: 14px 0 40px rgba(23,70,66,.16);
        transform: translateX(-105%);
        transition: transform .28s cubic-bezier(.22,1,.36,1);
        visibility: hidden;
    }
    .sidebar-heading {
        display: flex;
        margin-bottom: 15px;
    }
    .sidebar-collapse-toggle { display: none; }
    .mobile-nav-close {
        display: inline-flex;
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        border: 0;
        border-radius: 9px;
        background: #EAF9F5;
        color: #176B65;
        cursor: pointer;
    }
    .tab { min-height: 46px; flex: 0 0 auto; gap: 10px; padding: 0 13px; font-size: 13px; }
    .tab::before { top: 9px; right: auto; bottom: 9px; left: 0; width: 3px; height: auto; transform: scaleY(0); }
    .tab.active::before { transform: scaleY(1); }
    #dashboard.mobile-nav-open::before {
        position: fixed;
        z-index: 1000;
        inset: 0;
        background: rgba(25,49,48,.35);
        content: "";
        animation: mint-fade .2s ease both;
    }
    #dashboard.mobile-nav-open .tabs {
        visibility: visible;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .header-container {
        align-items: flex-start;
    }
    .brand-logo {
        gap: 8px;
    }
    .brand-logo-image {
        width: 62px;
        max-width: 22vw;
        max-height: 42px;
    }
    .brand-copy h1 {
        font-size: 14px;
    }
    .brand-copy p {
        font-size: 10px;
    }
    .user-info {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    #dashboard .dashboard.container { padding-right: 12px; padding-left: 12px; }
    .dashboard-header h2 { font-size: 23px; }
    .stats-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .stat-card { min-width: 0; gap: 11px; padding: 16px 12px; }
    .stat-icon { width: 48px; height: 48px; flex: 0 0 48px; font-size: 21px; }
    .stat-info h3 { font-size: 29px; }
    .stat-info p { font-size: 12px; }
    .tab-content { padding: 20px 14px; }
    .table-container table { min-width: 740px; }
    .toast-region { right: 12px; left: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Admin profile */
.dashboard-avatar {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: linear-gradient(135deg, #343434, #171717);
    color: #fff;
}
.dashboard-avatar img, .sidebar-admin-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dashboard-avatar.has-image > i, .sidebar-admin-avatar.has-image > i { display: none; }
.sidebar-admin-profile {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 4px 0 12px;
    padding: 10px 8px;
    border: 1px solid #E8E8E8;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff, #FAF1F2);
}
.sidebar-admin-profile[hidden], .dashboard-avatar[hidden] { display: none !important; }
.sidebar-admin-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    overflow: hidden;
    border: 2px solid #C90016;
    border-radius: 50%;
    background: #242424;
    color: #fff;
}
.sidebar-admin-copy { display: grid; min-width: 0; gap: 2px; }
.sidebar-admin-copy strong { color: #202020; font-size: 12px; }
.sidebar-admin-copy small { color: #777; font-size: 10px; }
#dashboard.sidebar-collapsed .sidebar-admin-profile { justify-content: center; padding: 7px 0; }
#dashboard.sidebar-collapsed .sidebar-admin-copy { display: none; }
.admin-profile-page { min-width: 0; }
.profile-eyebrow {
    color: #A80012;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}
.admin-profile-notice {
    display: none;
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid #B7DEC6;
    border-radius: 10px;
    background: #F0FAF3;
    color: #24633A;
}
.admin-profile-notice.is-visible { display: block; animation: mint-tab-enter .2s ease both; }
.admin-profile-notice.is-error {
    border-color: #F0C1C6;
    background: #FFF3F4;
    color: #A80012;
}
.admin-profile-grid {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
    gap: 18px;
    align-items: start;
}
.admin-profile-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid #E8E8E8;
    border-radius: 15px;
    background: linear-gradient(150deg, #fff 72%, #FFFAFA);
    box-shadow: 0 5px 18px rgba(23, 23, 23, .045);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.admin-profile-card:hover {
    transform: translateY(-2px);
    border-color: #EBD0D3;
    box-shadow: 0 12px 28px rgba(23, 23, 23, .09);
}
.profile-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.profile-section-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 12px;
    background: #FAF1F2;
    color: #C90016;
}
.profile-card-heading h4 { color: #202020; font-size: 15px; }
.profile-card-heading p, .profile-help-text { color: #777; font-size: 12px; }
.profile-picture-preview {
    display: grid;
    width: 132px;
    height: 132px;
    margin: 0 auto 18px;
    place-items: center;
    overflow: hidden;
    border: 4px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #292929, #111);
    box-shadow: 0 0 0 2px #C90016, 0 10px 25px rgba(23, 23, 23, .14);
    color: #fff;
    font-size: 42px;
}
.profile-picture-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-picture-actions, .profile-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-picture-actions { justify-content: center; }
.profile-picture-card .profile-help-text { margin-top: 12px; text-align: center; }
.admin-profile-form .form-group { margin-bottom: 17px; }
.admin-profile-form .form-group input[readonly] {
    background: #F6F6F6;
    color: #666;
    cursor: not-allowed;
}
.admin-profile-form .profile-help-text { display: block; margin-top: 5px; }
.admin-security-card { grid-column: 2; }

@media (max-width: 900px) {
    .admin-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-security-card { grid-column: auto; }
    .admin-profile-card { padding: 19px; }
}
@media (max-width: 560px) {
    .dashboard-avatar { width: 34px; height: 34px; }
    .profile-form-actions > .btn, .profile-picture-actions > .btn { flex: 1 1 auto; }
}

.invoice-state-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    background: #EAF9F5;
    color: #176B65;
    font-size: 12px;
    font-weight: 650;
    text-transform: capitalize;
    white-space: nowrap;
}

.delivery-sent { background: #DDF5EE; }
.delivery-failed, .delivery-legacy_unknown { background: #F1F4F3; color: #71838A; }
.delivery-sending { background: #BDEDE1; }

.invoice-review-modal {
    width: min(1120px, 96%);
    max-width: 1120px;
    max-height: 94vh;
    margin: 3vh auto;
    scroll-padding-top: 88px;
    overscroll-behavior: contain;
}

.invoice-review-modal .modal-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

.invoice-review-subtitle {
    margin-top: 5px;
    color: #71838A;
    font-size: 13px;
}

.invoice-review-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    scroll-margin-top: 88px;
}

.invoice-review-summary > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #E4EFEC;
    border-radius: 11px;
    background: #F4F9F8;
    overflow-wrap: anywhere;
}

.invoice-review-summary strong {
    color: #71838A;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.invoice-review-summary span {
    color: #263746;
    font-size: 13px;
    font-weight: 600;
}

#invoiceReviewPreview {
    display: block;
    width: 100%;
    height: min(58vh, 680px);
    border: 1px solid #E4EFEC;
    border-radius: 12px;
    background: #F4F9F8;
}

.invoice-review-preview-caption {
    margin: 0 0 8px;
    color: #71838A;
    font-size: 13px;
}

.invoice-review-actions {
    flex-wrap: wrap;
    align-items: center;
}

.invoice-review-note {
    min-height: 20px;
    margin-top: 12px;
    color: #176B65;
    font-size: 13px;
}

@media (max-width: 768px) {
    .invoice-review-modal .modal-body { padding: 18px; }
    #invoiceReviewPreview { height: 48vh; }
    .invoice-review-actions { justify-content: stretch; }
    .invoice-review-actions button { flex: 1 1 100%; }
}

/* Premium red and black corporate theme */
:root {
    --primary: #171717;
    --secondary: #C90016;
    --success: #21865A;
    --warning: #B76E00;
    --danger: #A80012;
    --light: #F7F7F8;
    --dark: #171717;
    --admin: #A80012;
    --staff: #C90016;
    --shadow-sm: 0 2px 10px rgba(23, 23, 23, .05);
    --shadow-md: 0 8px 24px rgba(23, 23, 23, .08);
    --shadow-lg: 0 18px 48px rgba(23, 23, 23, .14);
    --transition-fast: .18s cubic-bezier(.2, .8, .2, 1);
    --transition-base: .28s cubic-bezier(.2, .8, .2, 1);
    --transition-slow: .45s cubic-bezier(.2, .8, .2, 1);
}

html { background: #F7F7F8; }
body {
    min-width: 320px;
    background: #F7F7F8;
    color: #202020;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
button, .tab, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(201, 0, 22, .24);
    outline-offset: 3px;
}

/* Login */
.login-container {
    isolation: isolate;
    background:
        radial-gradient(ellipse at 12% 18%, rgba(227, 38, 54, .22), transparent 36%),
        radial-gradient(ellipse at 90% 82%, rgba(168, 0, 18, .32), transparent 38%),
        linear-gradient(135deg, #171717 0%, #242424 53%, #3A080E 100%);
}
.login-container::before, .login-container::after {
    border-color: rgba(255, 255, 255, .09);
    background: linear-gradient(135deg, rgba(227, 38, 54, .22), rgba(255, 255, 255, .025));
}
.login-box {
    max-width: 460px;
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
}
.login-header .brand-logo-image { border-radius: 8px; }
.login-header p, .demo-credentials p { color: #777; }
.login-options {
    border: 1px solid #E8E8E8;
    background: #F7F7F8;
}
.login-option { color: #777; }
.login-option.active {
    background: linear-gradient(135deg, #C90016, #A80012);
    color: #fff;
}
.form-group label { color: #383838; }
.form-group input, .form-group select, .form-group textarea,
.remarks-filters input, .remarks-filters select,
.report-actions select, .report-actions input[type="search"],
.client-year-controls select, .search-box input,
.admin-notes-sidebar input, .admin-note-editor > input,
.admin-note-editor > textarea {
    border-color: #E8E8E8;
    background-color: #fff;
    color: #202020;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}
.form-group input::placeholder, .form-group textarea::placeholder,
.remarks-filters input::placeholder, .search-box input::placeholder {
    color: #999;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.remarks-filters input:focus, .remarks-filters select:focus,
.report-actions select:focus, .report-actions input[type="search"]:focus,
.client-year-controls select:focus, .search-box input:focus,
.admin-notes-sidebar input:focus, .admin-note-editor > input:focus,
.admin-note-editor > textarea:focus {
    border-color: #C90016;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(201, 0, 22, .09);
    transform: translateY(-1px);
}
.login-btn, .btn-primary, .btn-success, .btn-warning {
    border: 0;
    background: linear-gradient(120deg, #C90016, #A80012 55%, #E32636);
    background-size: 180% 100%;
    color: #fff;
    box-shadow: 0 7px 18px rgba(168, 0, 18, .17);
    transition: background-position var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast), filter var(--transition-base);
}
.login-btn:hover, .btn-primary:hover, .btn-success:hover, .btn-warning:hover {
    background-position: 100% 0;
    box-shadow: 0 11px 26px rgba(168, 0, 18, .25);
    filter: brightness(1.04);
    transform: translateY(-2px);
}
.btn-secondary { background: #242424; color: #fff; }
.btn-secondary:hover { background: #3A3A3A; transform: translateY(-2px); }
.btn-danger { background: #A80012; color: #fff; }
.btn-danger:hover { background: #8D0010; transform: translateY(-2px); }
.login-btn:active, .btn:active, .logout-btn:active, .action-btn:active { transform: translateY(1px) scale(.98); }
.demo-credentials {
    border-left-color: #C90016;
    background: #FAF1F2;
}
.demo-credentials h4 { color: #171717; }

/* Branded application header and workspace */
header {
    overflow: hidden;
    border-bottom: 3px solid #C90016;
    background: linear-gradient(115deg, #171717, #242424 68%, #171717);
    box-shadow: 0 5px 22px rgba(0, 0, 0, .16);
}
header::before { opacity: .35; }
.brand-logo-image { border-radius: 6px; }
.brand-copy h1 { color: #fff; }
.brand-copy p { color: rgba(255, 255, 255, .72); }
.user-role, .user-role.staff {
    background: rgba(201, 0, 22, .2);
    box-shadow: inset 0 0 0 1px rgba(227, 38, 54, .32);
    color: #fff;
}
.user-role:hover { box-shadow: inset 0 0 0 1px rgba(227, 38, 54, .55); }
.logout-btn {
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}
.logout-btn:hover { background: #A80012; }
#dashboard .dashboard.container {
    width: min(100% - 40px, 1540px);
    max-width: 1540px;
    gap: 0 24px;
    padding-top: 30px;
    padding-bottom: 48px;
}
.dashboard-header h2, .form-title h3 { color: #202020; }
.dashboard-header h2 { letter-spacing: -.035em; }
.dashboard-header .btn { flex: 0 0 auto; }
.tabs {
    border-color: #E8E8E8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(23, 23, 23, .07);
}
.sidebar-brand {
    display: flex;
    min-height: 66px;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 14px;
    border-bottom: 1px solid #E8E8E8;
}
.sidebar-brand img {
    display: block;
    width: 58px;
    height: 42px;
    flex: 0 0 58px;
    border-radius: 4px;
    background: #fff;
    object-fit: contain;
}
.sidebar-brand-copy { display: grid; min-width: 0; gap: 3px; }
.sidebar-brand-copy strong {
    color: #202020;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.sidebar-brand-copy span { color: #777; font-size: 10px; }
.sidebar-heading { border-bottom-color: #E8E8E8; color: #777; }
.sidebar-heading-icon {
    background: #FAF1F2;
    color: #C90016;
}
.sidebar-collapse-toggle, .mobile-nav-close {
    background: #FAF1F2;
    color: #A80012;
}
.sidebar-collapse-toggle:hover, .mobile-nav-close:hover { background: #F5E3E5; }
.tab { color: #666; }
.tab i { color: #8A8A8A; }
.tab::before { background: #C90016; }
.tab::after, .tab.active { background: #FAF1F2; }
.tab:hover { background: #F7F7F8; color: #A80012; }
.tab:hover i, .tab.active, .tab.active i { color: #A80012; }

/* Dashboard cards, data panels and metrics */
.stats-container { gap: 17px; margin-bottom: 24px; }
.stat-card, .task-stat-card {
    border: 1px solid #E8E8E8;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23, 23, 23, .045);
}
.stat-card::before { background: linear-gradient(110deg, transparent, rgba(201, 0, 22, .06), transparent); }
.stat-card:hover, .task-stat-card:hover {
    border-color: #EBD0D3;
    box-shadow: 0 14px 30px rgba(23, 23, 23, .1);
    transform: translateY(-4px);
}
.stat-icon.total, .stat-icon.pending, .stat-icon.not-found,
.task-stat-icon.pending, .task-stat-icon.in-progress, .task-stat-icon.completed {
    background: linear-gradient(135deg, #C90016, #A80012);
    box-shadow: 0 5px 15px rgba(168, 0, 18, .17);
    color: #fff;
}
.stat-icon.found {
    background: linear-gradient(135deg, #242424, #444);
    box-shadow: 0 5px 15px rgba(23, 23, 23, .14);
    color: #fff;
}
.stat-info h3, .task-stat-info h4 { color: #202020; }
.stat-info p, .task-stat-info p { color: #777; }
.tab-content {
    border: 1px solid #E8E8E8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(23, 23, 23, .05);
}
.tab-content.active { animation: mint-tab-enter .32s cubic-bezier(.22, 1, .36, 1) both; }
.form-title { border-bottom-color: #E8E8E8; }
.form-title h3 { letter-spacing: -.02em; }
.client-year-controls label, .report-actions label,
.referral-year-summary h5, .remark-details summary { color: #A80012; }
.client-year-count, .admin-notes-list-status,
.admin-notes-empty, .report-remarks-note { color: #777; }
.reports-container { gap: 20px; }
.report-card, .report-remarks-panel, .admin-notes-layout,
.admin-notes-sidebar, .admin-note-editor {
    border-color: #E8E8E8;
}
.report-card {
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23, 23, 23, .045);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.report-card:hover { border-color: #EBD0D3; box-shadow: 0 12px 28px rgba(23, 23, 23, .09); transform: translateY(-2px); }
.report-card h4, .report-remarks-panel h4 { color: #202020; }
.report-summary-card, .invoice-review-summary > div {
    border-color: #E8E8E8;
    border-radius: 12px;
    background: #FAF1F2;
}
.report-summary-card span, .invoice-review-summary strong { color: #777; }
.report-summary-card strong, .invoice-review-summary span { color: #202020; }
.report-summary-error, .report-remarks-error { color: #A80012; }
#monthlyChart, #statusChart {
    border: 1px solid #E8E8E8;
    background: linear-gradient(145deg, #fff, #FAF1F2);
    color: #777;
}
.chart-bar, .chart-progress { border-radius: 6px; }

/* Tables, state labels and action controls */
.table-container {
    max-width: 100%;
    border: 1px solid #E8E8E8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(23, 23, 23, .035);
    overscroll-behavior-x: contain;
}
table { margin-top: 0; }
table th {
    background: linear-gradient(110deg, #171717, #303030);
    color: #fff;
    font-size: 13px;
    letter-spacing: .01em;
}
table td { border-bottom-color: #EEEEEF; color: #444; }
table tbody tr { transition: background-color var(--transition-fast); }
table tr:nth-child(even) { background: #FCFCFC; }
table tbody tr:hover { background: #FCF2F3; transform: none; }
.status-badge, .priority-badge, .invoice-state-badge {
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .025em;
    transition: background-color var(--transition-base), color var(--transition-base), transform var(--transition-fast);
}
.status-pending, .priority-medium, .status-in-progress, .delivery-sending {
    border-color: #F0D8B8;
    background: #FFF5E7;
    color: #875000;
}
.status-found, .priority-low, .delivery-sent {
    border-color: #CFE6D8;
    background: #EEF8F1;
    color: #246A43;
}
.status-not-found, .priority-high, .priority-critical {
    border-color: #F0CDD1;
    background: #FAEDEF;
    color: #A80012;
}
.status-on-hold, .delivery-failed, .delivery-legacy_unknown {
    border-color: #E8E8E8;
    background: #F2F2F3;
    color: #666;
}
.invoice-state-badge { border-color: #EBD0D3; background: #FAF1F2; color: #A80012; }
.action-btn {
    border-radius: 7px;
    transition: transform var(--transition-fast), box-shadow var(--transition-base), background-color var(--transition-base), color var(--transition-base);
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(23, 23, 23, .12); }
.action-btn.edit, .action-btn.invoice, .action-btn.remark {
    background: #FAF1F2;
    color: #A80012;
}
.action-btn.delete { background: #FBEAEC; color: #A80012; }
.action-btn.whatsapp { background: #EAF6EF; color: #21865A; }
.action-btn.edit:hover, .action-btn.invoice:hover, .action-btn.remark:hover,
.action-btn.delete:hover { background: #A80012; color: #fff; }
.action-btn.whatsapp:hover { background: #21865A; color: #fff; }

/* Forms, notes, invoice details and dialogs */
.remarks-filters { gap: 12px; }
.remarks-filters input, .remarks-filters select,
.report-actions select, .report-actions input[type="search"],
.client-year-controls select, .search-box input,
.admin-notes-sidebar input, .admin-note-editor > input,
.admin-note-editor > textarea { border-radius: 9px; }
.admin-notes-layout, .admin-notes-sidebar, .admin-note-editor {
    border-color: #E8E8E8;
    border-radius: 13px;
}
.admin-note-list-item {
    border-color: transparent;
    background: #F7F7F8;
    color: #202020;
}
.admin-note-list-item:hover, .admin-note-list-item.active {
    border-color: #EBD0D3;
    background: #FAF1F2;
}
.admin-note-list-item span, .admin-note-editor-header,
.invoice-review-subtitle, .invoice-review-summary strong { color: #777; }
.admin-note-editor > input:disabled, .admin-note-editor > textarea:disabled { background: #F7F7F8; }
.modal { background: rgba(23, 23, 23, .52); backdrop-filter: blur(6px); }
.modal.is-closing { opacity: 0; transition: opacity .2s ease; }
.modal-content {
    border: 1px solid #E8E8E8;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
    animation: mint-modal-enter .28s cubic-bezier(.22, 1, .36, 1) both;
    transition: opacity .2s ease, transform .2s ease;
}
.modal.is-closing .modal-content { opacity: 0; transform: translateY(8px) scale(.97); }
.modal-header, .form-actions { border-color: #E8E8E8; }
.modal-header h3, .remark-latest h4 { color: #202020; }
.close { border-radius: 9px; }
.close:hover { color: #A80012; background: #FAF1F2; }
.remark-client-info, .remark-latest, .invoice-client-preview {
    border: 1px solid #E8E8E8;
    background: #F7F7F8;
}
.remark-latest small, .remark-examples, .invoice-review-subtitle { color: #777; }
.remark-error { color: #A80012; }
.invoice-review-modal .modal-header { background: #fff; }
#invoiceReviewPreview {
    border-color: #E8E8E8;
    background: #F7F7F8;
}
.invoice-review-note { color: #A80012; }

/* Responsive refinements */
@media (max-width: 1024px) and (min-width: 769px) {
    #dashboard .dashboard.container { width: calc(100% - 32px); }
    .form-title { flex-wrap: wrap; }
    .client-year-controls {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .client-year-controls .search-box { min-width: 0; flex: 1 1 220px; }
    .client-year-controls .search-box input { width: 100%; max-width: 100%; }
    .form-title > .search-box { min-width: 0; flex: 1 1 220px; }
    .form-title > .search-box input { width: 100%; max-width: 100%; }
    #dashboard.sidebar-collapsed .sidebar-brand { justify-content: center; padding-right: 0; padding-left: 0; }
    #dashboard.sidebar-collapsed .sidebar-brand img { width: 44px; height: 38px; flex-basis: 44px; }
    #dashboard.sidebar-collapsed .sidebar-brand-copy { display: none; }
}
@media (max-width: 768px) {
    header { padding: 12px 0; }
    .header-container { flex-wrap: wrap; gap: 12px; }
    .user-info { flex-wrap: wrap; justify-content: flex-end; }
    .mobile-nav-toggle {
        border-color: #E8E8E8;
        background: #fff;
        color: #A80012;
        box-shadow: 0 3px 10px rgba(23, 23, 23, .07);
    }
    #dashboard.mobile-nav-open::before { background: rgba(23, 23, 23, .48); }
    #dashboard .dashboard.container { width: 100%; padding: 20px 16px 36px; }
    .dashboard-header { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
    .dashboard-header h2 { flex: 1; font-size: clamp(20px, 5vw, 25px); }
    .dashboard-header > .btn { width: 100%; justify-content: center; }
    .stats-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .stat-card { min-width: 0; gap: 11px; padding: 16px 12px; }
    .stat-icon { width: 48px; height: 48px; flex: 0 0 48px; font-size: 20px; }
    .stat-info h3 { font-size: 28px; }
    .stat-info p { font-size: 11px; }
    .tab-content { padding: 20px 14px; }
    .form-title { align-items: flex-start; gap: 14px; }
    .form-title > .btn, .form-title > .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .table-container { margin-top: 16px; }
    .table-container table { min-width: 740px; }
    .reports-container { grid-template-columns: minmax(0, 1fr); }
    .report-actions { width: 100%; justify-content: flex-start; }
    .report-actions select, .report-actions input[type="search"] { flex: 1 1 100%; min-width: 0; }
    .report-actions button { flex: 1 1 auto; justify-content: center; }
    .client-year-controls { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .client-year-controls select { flex: 1 1 100%; min-width: 0; }
    .client-year-controls .search-box { flex: 1 1 100%; }
    .remarks-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
    .remarks-filters input, .remarks-filters select { width: 100%; min-width: 0; }
    .modal-content { width: min(95%, 700px); max-height: 92vh; margin: 4vh auto; }
    .modal-header, .modal-body { padding: 20px; }
    .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .form-actions { flex-wrap: wrap; gap: 10px; }
    .form-actions > button { flex: 1 1 auto; justify-content: center; }
    .invoice-review-modal { width: 96%; }
    .invoice-review-actions button { flex: 1 1 100%; }
    .toast-region { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 480px) {
    .container { padding-right: 14px; padding-left: 14px; }
    .brand-logo { gap: 8px; }
    .brand-logo-image { width: 62px; max-width: 22vw; max-height: 42px; }
    .brand-copy h1 { font-size: 14px; }
    .brand-copy p { font-size: 10px; }
    .user-info { gap: 7px; }
    .user-role { padding: 5px 9px; font-size: 10px; }
    .logout-btn { padding: 8px 10px; font-size: 12px; }
    #dashboard .dashboard.container { padding-right: 12px; padding-left: 12px; }
    .stats-container { gap: 9px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 11px; }
    .stat-info h3 { font-size: 25px; }
    .stat-info p { font-size: 10px; }
    .tab-content { padding: 17px 12px; }
    .form-title h3 { font-size: 19px; }
    .btn { padding: 11px 15px; font-size: 14px; }
    .modal-content { width: calc(100% - 20px); margin: 10px auto; max-height: calc(100dvh - 20px); }
    .modal-header, .modal-body { padding: 16px; }
    .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .report-summary-card { min-height: 80px; padding: 11px; }
}
@keyframes premium-gradient-drift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Restrained red-black finish for the existing dashboard shell and controls. */
header {
    position: relative;
    isolation: isolate;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #7D0010, #E32636, #7D0010) 1;
    background:
        radial-gradient(ellipse at 82% 0%, rgba(201, 0, 22, .28), transparent 40%),
        linear-gradient(115deg, #111 0%, #272124 52%, #3A1016 100%);
    background-size: 180% 180%;
    animation: premium-gradient-drift 16s ease-in-out infinite;
    box-shadow: 0 8px 28px rgba(48, 0, 9, .2);
}
header::before {
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .09) 48%, transparent 76%);
    animation-duration: 5s;
}
.brand-copy h1 { text-shadow: 0 2px 14px rgba(227, 38, 54, .22); }
.user-role, .user-role.staff {
    background: linear-gradient(135deg, rgba(201, 0, 22, .34), rgba(75, 12, 20, .58));
    box-shadow: inset 0 0 0 1px rgba(255, 115, 128, .28), 0 5px 16px rgba(70, 0, 10, .2);
}
.logout-btn {
    background: linear-gradient(125deg, rgba(255, 255, 255, .13), rgba(201, 0, 22, .22));
    transition: background var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}
.logout-btn:hover {
    background: linear-gradient(125deg, #C90016, #72000D);
    box-shadow: 0 7px 20px rgba(168, 0, 18, .3);
}

.tabs {
    border-color: #3D292D;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(201, 0, 22, .2), transparent 46%),
        linear-gradient(155deg, #191719 0%, #242124 58%, #32171D 100%);
    box-shadow: 0 14px 34px rgba(30, 0, 7, .18), inset 0 1px rgba(255, 255, 255, .045);
}
.sidebar-brand { border-bottom-color: rgba(255, 255, 255, .12); }
.sidebar-brand img { box-shadow: 0 4px 16px rgba(0, 0, 0, .24); }
.sidebar-brand-copy strong { color: #fff; }
.sidebar-brand-copy span, .sidebar-heading { color: #C6B9BC; }
.sidebar-heading { border-bottom-color: rgba(255, 255, 255, .12); }
.sidebar-heading-icon, .sidebar-collapse-toggle, .mobile-nav-close {
    background: linear-gradient(135deg, rgba(201, 0, 22, .3), rgba(105, 0, 13, .38));
    color: #FF9AA4;
}
.sidebar-collapse-toggle:hover, .mobile-nav-close:hover {
    background: linear-gradient(135deg, #C90016, #76000E);
    color: #fff;
}
.tab {
    color: #D0C8CA;
    transition: color var(--transition-base), background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
}
.tab i { color: #B49DA2; }
.tab::before { background: linear-gradient(180deg, #FF5968, #A80012); }
.tab::after {
    background: linear-gradient(110deg, rgba(201, 0, 22, .25), rgba(97, 10, 22, .36));
}
.tab:hover {
    background: linear-gradient(110deg, rgba(201, 0, 22, .18), rgba(255, 255, 255, .035));
    color: #fff;
}
.tab:hover i { color: #FF8A96; }
.tab.active {
    background: linear-gradient(110deg, rgba(201, 0, 22, .35), rgba(93, 12, 24, .5));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 119, 132, .16), 0 5px 16px rgba(111, 0, 14, .2);
}
.tab.active i { color: #FF9AA4; }
.tab.active::before { box-shadow: 0 0 12px rgba(255, 72, 89, .65); }

.btn-secondary {
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(125deg, #343034, #171517 72%, #42131B);
    color: #fff;
    box-shadow: 0 5px 14px rgba(32, 0, 8, .12);
    transition: background var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast), border-color var(--transition-base);
}
.btn-secondary:hover {
    border-color: rgba(255, 112, 126, .38);
    background: linear-gradient(125deg, #4A252C, #24191C 70%, #650D1A);
    box-shadow: 0 8px 20px rgba(120, 0, 16, .2);
}
.btn-primary, .btn-success, .btn-warning, .login-btn {
    background: linear-gradient(120deg, #E32636, #A80012 48%, #35151A 100%);
    background-size: 180% 100%;
}
.btn-primary:hover, .btn-success:hover, .btn-warning:hover, .login-btn:hover {
    box-shadow: 0 10px 24px rgba(168, 0, 18, .28), 0 0 0 1px rgba(255, 101, 116, .14);
}
.action-btn.edit, .action-btn.invoice, .action-btn.remark {
    background: linear-gradient(135deg, #FFF4F5, #F8E7E9);
    box-shadow: inset 0 0 0 1px rgba(201, 0, 22, .06);
}
.action-btn.edit:hover, .action-btn.invoice:hover, .action-btn.remark:hover,
.action-btn.delete:hover {
    background: linear-gradient(125deg, #E32636, #A80012 62%, #5B0A14);
    box-shadow: 0 6px 16px rgba(168, 0, 18, .24);
}

table th {
    background: linear-gradient(110deg, #171416 0%, #302327 52%, #680D1A 100%);
    box-shadow: inset 0 -2px 0 rgba(227, 38, 54, .72);
}
.table-container {
    border-color: #E8DADD;
    box-shadow: 0 7px 22px rgba(46, 0, 9, .055);
}
table tbody tr:hover { box-shadow: inset 3px 0 0 rgba(201, 0, 22, .48); }
.stat-card, .task-stat-card, .report-card, .tab-content, .report-remarks-panel {
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.stat-card, .task-stat-card, .report-card {
    background: linear-gradient(145deg, #fff 62%, #FFF7F8);
}
.stat-card:hover, .task-stat-card:hover, .report-card:hover {
    border-color: #E7B8BE;
    box-shadow: 0 15px 32px rgba(95, 0, 13, .11), 0 0 0 1px rgba(201, 0, 22, .035);
}
.tab-content { background: linear-gradient(150deg, #fff 72%, #FFFAFA); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.remarks-filters input:focus, .remarks-filters select:focus,
.report-actions select:focus, .report-actions input[type="search"]:focus,
.client-year-controls select:focus, .search-box input:focus,
.admin-notes-sidebar input:focus, .admin-note-editor > input:focus,
.admin-note-editor > textarea:focus {
    box-shadow: 0 0 0 3px rgba(201, 0, 22, .1), 0 5px 14px rgba(116, 0, 15, .07);
}
.mobile-nav-toggle {
    border-color: #E7CDD1;
    background: linear-gradient(135deg, #fff, #FFF2F4);
    box-shadow: 0 5px 16px rgba(80, 0, 10, .1);
    transition: transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-base);
}
.mobile-nav-toggle:hover {
    background: linear-gradient(135deg, #FFF2F4, #F8E1E4);
    box-shadow: 0 8px 20px rgba(120, 0, 16, .16);
    transform: translateY(-2px);
}
.modal-content {
    border-color: rgba(201, 0, 22, .14);
    box-shadow: 0 28px 80px rgba(28, 0, 6, .3);
}
.modal-header {
    background: linear-gradient(105deg, #fff, #FFF7F8 78%, #FBEAEC);
}
.close:hover { box-shadow: 0 4px 12px rgba(168, 0, 18, .1); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}