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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-14px) rotate(-45deg);
}

.header-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    flex-wrap: wrap;
}

/* User Info Header (added by user management module) */
.user-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    color: white;
}

.user-role {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
}

.user-region {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
}

.logout-btn-header {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.logout-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* User Management Styles */
#users {
    background: #f8f9fa;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#users h2 {
    color: #2d3748;
    font-size: 28px;
    margin-top: 0 !important;
    margin-bottom: 25px;
    padding-top: 0 !important;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}
}

.user-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1.5fr auto;
    gap: 15px;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.user-card:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
    border-color: #667eea;
}

.user-card .user-name {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
}

.user-card .user-email {
    color: #4a5568;
    font-size: 14px;
}

.user-card .user-role {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-card .user-region {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

.user-card button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.user-card button:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

#users-list {
    margin-top: 30px;
}

/* User management Add New User button - uses base .btn .btn-primary */

/* Manage Users Tab Button - Special Styling */
#users-tab {
    position: relative;
}

#users-tab::before {
    content: '👥 ';
    margin-right: 5px;
}

#users-tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
    font-weight: 600;
}

#users-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Responsive Design for User Cards */
@media (max-width: 1024px) {
    .user-card {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .user-card .user-name {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .user-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .user-card button {
        width: 100%;
    }
}

/* Officer Stats Widget */
.officer-stats-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.officer-stats-widget h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    background: #f5f7fa;
    border-bottom: 2px solid #e1e8ed;
    padding: 0 20px;
    overflow-x: auto;
    flex-shrink: 0;
    z-index: 10;
}

.tab-btn {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #5a6c7d;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

/* Tab Content */
.tab-content {
    display: none;
    padding-top: 0;
    padding-right: 30px;
    padding-bottom: 30px;
    padding-left: 30px;
    animation: fadeIn 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    background: white;
    box-sizing: border-box;
    position: relative;
}

.tab-content.active {
    display: block;
}

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

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

.last-update {
    color: #8b95a5;
    font-size: 13px;
}

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

.stat-card {
    padding: 25px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.stat-card.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-card.green { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.stat-card.orange { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-card.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.stat-value {
    font-size: 48px !important;
    font-weight: 700 !important;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    line-height: 1.1;
    letter-spacing: -1px;
    color: white !important;
}

.stat-label {
    font-size: 16px !important;
    font-weight: 500 !important;
    opacity: 0.95;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    color: white !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 400px;
    min-height: 400px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.dashboard-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.dashboard-section canvas {
    max-height: 300px !important;
    height: 300px !important;
    max-width: 100% !important;
    flex-shrink: 0;
}

.dashboard-section > div {
    position: relative;
    height: 300px;
    max-height: 300px;
    overflow: visible; /* Changed from hidden to allow child scrolling */
}

.recent-list, .schedule-list {
    height: 300px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
}

.recent-item, .schedule-item {
    padding: 12px;
    background: white;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    font-size: 14px;
}

.schedule-item {
    border-left-color: #e74c3c;
}

/* Forms */
.case-form {
    max-width: 900px;
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.section-title {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-subsection {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e1e8ed;
}

.subsection-title {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.conflict-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-left: 4px solid #ff9800;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    color: #856404;
    font-weight: 500;
}

.conflict-warning::before {
    content: "⚠️ ";
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label small {
    font-weight: normal;
    color: #7f8c8d;
    font-size: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    padding: 15px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-label input[type="checkbox"]:checked + span,
.checkbox-label:has(input[type="checkbox"]:checked) {
    font-weight: 600;
    color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Table */
.cases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cases-actions {
    display: flex;
    gap: 15px;
}

.cases-actions select {
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e8ed;
    font-size: 14px;
}

tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    min-width: fit-content;
    text-align: center;
}

.status-pending { background: #ffeaa7; color: #d63031; }
.status-investigation { background: #74b9ff; color: #0984e3; }
.status-conciliation { background: #a29bfe; color: #6c5ce7; }
.status-arbitration { background: #fdcb6e; color: #e17055; }
.status-resolved { background: #55efc4; color: #00b894; }
.status-closed { background: #dfe6e9; color: #2d3436; }

.priority-high { color: #e74c3c; font-weight: bold; }
.priority-medium { color: #f39c12; font-weight: bold; }
.priority-low { color: #3498db; font-weight: bold; }

.action-btn {
    padding: 6px 12px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.action-btn-view {
    background: #3498db;
    color: white;
}

.action-btn-edit {
    background: #f39c12;
    color: white;
}

.action-btn-delete {
    background: #e74c3c;
    color: white;
}

/* Search */
.search-container {
    max-width: 800px;
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.search-results {
    margin-top: 20px;
}

.search-result-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.search-result-item h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.search-result-item p {
    margin: 5px 0;
    font-size: 14px;
    color: #5a6c7d;
}

/* Calendar */
.calendar-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

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

.calendar-header button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    padding: 10px;
    background: white;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-day.has-event {
    background: #e8f4f8;
    border: 2px solid #3498db;
}

.calendar-day.has-event.conciliation {
    background: #fff3cd;
    border-color: #f39c12;
}

.calendar-day.has-event.arbitration {
    background: #f8d7da;
    border-color: #e74c3c;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.calendar-legend div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-conciliation,
.legend-arbitration {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-conciliation {
    background: #f39c12;
}

.legend-arbitration {
    background: #e74c3c;
}

.schedule-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

#scheduled-events {
    margin-top: 15px;
}

/* Reports */
.report-form {
    max-width: 800px;
    margin-bottom: 30px;
}

.report-period-options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.report-output {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 600px;
    overflow-y: auto;
}

.report-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.report-output th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.report-output td {
    padding: 10px 12px;
    border-bottom: 1px solid #e1e8ed;
}

.report-output tr:nth-child(even) {
    background: white;
}

.report-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.report-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Settings */
.settings-container {
    max-width: 700px;
}

.settings-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.settings-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.warning-text {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    overflow-y: auto;
    padding: 20px;
}

.modal[style*="display: block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: auto;
}

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

.modal-header h2 {
    color: #2c3e50;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #95a5a6;
    cursor: pointer;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #e1e8ed;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.detail-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
}

.detail-value {
    color: #5a6c7d;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .cases-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .cases-actions {
        width: 100%;
        flex-direction: column;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .header,
    .tabs,
    .report-form,
    .btn {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        max-height: none;
    }
    
    .tab-content {
        display: block !important;
        padding: 0;
        max-height: none;
        overflow: visible;
    }
    
    .report-output {
        background: white;
        box-shadow: none;
        max-height: none;
        overflow: visible;
        page-break-inside: avoid;
    }
    
    .report-section {
        page-break-inside: avoid;
    }
    
    /* Ensure NECCS section prints correctly */
    .neccs-section {
        page-break-inside: avoid;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force print-friendly solid colors for NECCS section */
    .neccs-main-box {
        background: #667eea !important; /* Solid purple instead of gradient */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .neccs-card {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Specific solid colors for each card type */
    .neccs-card.registered {
        background: #28a745 !important; /* Solid green */
    }
    
    .neccs-card.unregistered {
        background: #dc3545 !important; /* Solid red */
    }
    
    .neccs-card.unknown {
        background: #6c757d !important; /* Solid gray */
    }
    
    .report-section h3 {
        page-break-after: avoid;
    }
    
    /* Print gradients as solid colors for better compatibility */
    .report-section div[style*="linear-gradient"] {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    canvas {
        max-width: 100%;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    /* Ensure charts section doesn't break awkwardly */
    .report-section:has(canvas) {
        page-break-before: always;
    }
}

/* Email Scheduler Styles */
.schedules-container {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.schedule-card {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.schedule-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.schedule-card.inactive {
    opacity: 0.6;
    background: #f8f9fa;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.schedule-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.schedule-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

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

.schedule-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.schedule-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.schedule-detail {
    display: flex;
    flex-direction: column;
}

.schedule-detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.schedule-detail-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.schedule-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

.schedule-option {
    margin-top: 15px;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.info-box h4 {
    color: #1565c0;
    margin: 0 0 10px 0;
}

.info-box p, .info-box ul {
    color: #1976d2;
    margin: 5px 0;
}

.next-run-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 10px;
}

/* Settings & Backup Styles */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    margin: 15px 0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #95a5a6;
}

.status-dot.active {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
    animation: pulse 2s infinite;
}

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

.last-save-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.last-save-info p {
    margin: 5px 0;
    color: #2c3e50;
}

.storage-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item .stat-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
}

.stat-item .stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

.system-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.system-info p {
    margin: 10px 0;
    color: #2c3e50;
}

.backup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cloud Storage Integration Styles */
.cloud-service-card {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.cloud-service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.cloud-service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.cloud-service-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 18px;
}

.cloud-service-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

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

.status-badge.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.syncing {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1.5s infinite;
}

.cloud-service-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cloud-sync-settings {
    margin-top: 30px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
}

.cloud-sync-settings h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.action-btn-status {
    background: #27ae60 !important;
}

.action-btn-status:hover {
    background: #229954 !important;
}

.action-btn-schedule {
    background: #3498db !important;
}

.action-btn-schedule:hover {
    background: #2980b9 !important;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.modal-body h4 {
    margin: 20px 0 10px 0;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.modal-body .form-group label input[type="checkbox"] {
    margin-right: 8px;
}

#status-current {
    display: inline-block;
    padding: 5px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #667eea;
    font-weight: 600;
}

/* ============================================ */
/* RESPONSIVE DESIGN FOR ALL DEVICES */
/* ============================================ */

/* Large Desktop (1200px+) - Default styles apply */

/* Medium Desktop and Laptop (992px - 1199px) */
@media screen and (max-width: 1199px) {
    .container {
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet (768px - 991px) */
@media screen and (max-width: 991px) {
    body {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile and Small Tablet (Up to 767px) */
@media screen and (max-width: 767px) {
    /* Body and Container */
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 5px;
        min-height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }
    
    /* Header - Make it Mobile Friendly */
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header-info {
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    /* Navigation Tabs - Horizontal Scroll */
    .tabs {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .tabs::-webkit-scrollbar {
        height: 3px;
    }
    
    .tabs::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 13px;
        min-width: 100px;
        white-space: nowrap;
    }
    
    /* Tab Content */
    .tab-content {
        padding: 15px;
    }
    
    /* Dashboard - Stack Stats Vertically */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 36px !important;
    }
    
    .stat-label {
        font-size: 14px !important;
    }
    
    /* Dashboard Grid - Stack */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-section {
        height: auto;
        min-height: 300px;
        max-height: 400px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Forms - Stack Form Fields */
    .form-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .form-section h3 {
        font-size: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents auto-zoom on iOS */
        padding: 12px;
    }
    
    /* Buttons - Full Width on Mobile */
    .btn {
        padding: 14px 20px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Action Buttons - Stack Vertically */
    .action-btn {
        padding: 10px 15px;
        font-size: 12px;
        margin: 3px 0;
        display: block;
        width: 100%;
    }
    
    /* Tables - Horizontal Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    table {
        min-width: 900px;
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
    
    /* Modals - Full Screen on Mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Search and Filter - Stack */
    .search-bar,
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-bar input,
    .filter-bar select,
    .filter-bar input {
        width: 100%;
        font-size: 16px;
    }
    
    /* Calendar - Smaller on Mobile */
    .calendar {
        font-size: 11px;
    }
    
    .calendar-header h3 {
        font-size: 16px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 4px;
        font-size: 11px;
    }
    
    .calendar-event {
        font-size: 9px;
        padding: 2px 4px;
        margin: 2px 0;
    }
    
    /* Settings - Stack Everything */
    .settings-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .storage-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cloud-service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cloud-service-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .cloud-service-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Reports */
    .report-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .report-controls > * {
        width: 100%;
    }
    
    /* Email Scheduler */
    .schedule-list {
        padding: 10px;
    }
    
    .schedule-item {
        padding: 12px;
    }
}

/* Extra Small Mobile (Up to 480px) */
@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .stat-value {
        font-size: 32px !important;
    }
    
    .stat-label {
        font-size: 13px !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
    
    table {
        font-size: 12px;
        min-width: 800px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .calendar {
        font-size: 10px;
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 3px;
    }
}

/* Tablet Landscape (769px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for fingers */
    .btn,
    .action-btn,
    .tab-btn,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .close {
        font-size: 40px;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Prevent text selection on UI elements */
    .btn,
    .tab-btn,
    .action-btn,
    .stat-card {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Smooth scrolling for touch */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .action-btn:hover,
    .tab-btn:hover {
        transform: none;
    }
}

/* Landscape Mode on Phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 10px 20px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .tabs {
        padding: 0 10px;
    }
    
    .tab-btn {
        padding: 8px 12px;
    }
    
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .stat-card {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .header,
    .tabs,
    .btn,
    .action-btn,
    .modal,
    .close {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        max-height: none;
        border: none;
    }
    
    .tab-content {
        display: block !important;
        padding: 0;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    .stat-card {
        page-break-inside: avoid;
    }
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn,
    .action-btn {
        border: 2px solid currentColor;
    }
    
    .stat-card {
        border: 2px solid white;
    }
}

/* ============================================ */
/* END RESPONSIVE DESIGN */
/* ============================================ */

/* ============================================================
   LOGIN SCREEN STYLES
   ============================================================ */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.5s ease-out;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.6s ease-out;
    position: relative;
}

.login-header {
    margin-bottom: 40px;
}

.login-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.login-form {
    margin-bottom: 30px;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 25px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.input-icon {
    font-size: 18px;
}

.login-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    background: #fee;
    color: #c33;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.5s;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #7f8c8d;
    font-size: 13px;
    margin: 5px 0;
}

.login-settings {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-settings-icon {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-settings-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: rotate(90deg);
}

.main-app {
    width: 100%;
    height: 100%;
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Logout Button in Header */
.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Password Settings Modal */
.password-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.password-settings-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.password-settings-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-settings-content .form-group {
    margin-bottom: 20px;
}

.password-settings-content label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.password-settings-content input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.password-settings-content input:focus {
    outline: none;
    border-color: #667eea;
}

.password-settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.password-settings-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-password {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-save-password:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-cancel-password {
    background: #e0e0e0;
    color: #2c3e50;
}

.btn-cancel-password:hover {
    background: #d0d0d0;
}

/* Responsive */
@media (max-width: 600px) {
    .login-container {
        padding: 40px 30px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
    
    .login-logo {
        font-size: 60px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* PHASE 2A - DOCUMENT MANAGEMENT STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

.document-item {
    background: #ffffff;
    transition: all 0.3s ease;
}

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

.doc-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #667eea;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

#document-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

#document-preview-container img {
    object-fit: contain;
}

/* Upload progress bar */
#upload-progress {
    animation: fadeIn 0.3s ease;
}

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

/* Document upload modal specific styles */
#document-upload-modal input[type="file"] {
    padding: 12px;
    border: 2px dashed #dfe6e9;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

#document-upload-modal input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* END DOCUMENT MANAGEMENT STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════ */
/* PHASE 2A - FEATURE 2: ADVANCED ANALYTICS DASHBOARD STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

.stat-change {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-weight: normal;
}

#analytics .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

#analytics .dashboard-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#analytics .dashboard-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

#analytics canvas {
    max-height: 300px;
}

.form-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

/* Analytics specific stat cards */
#analytics .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #analytics .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    #analytics canvas {
        max-height: 250px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* END ADVANCED ANALYTICS DASHBOARD STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════ */
/* PHASE 2A - FEATURE 3: ADVANCED SEARCH & SAVED SEARCHES STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

.quick-filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.saved-searches-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.advanced-filters-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease;
}

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

.search-history-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-quick-filter {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-quick-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-quick-filter:active {
    transform: translateY(0);
}

.search-result-card {
    transition: all 0.3s ease;
}

.search-result-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

#search .form-group {
    margin-bottom: 0;
}

#search .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

#search .form-group input,
#search .form-group select,
#search .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#search .form-group input:focus,
#search .form-group select:focus,
#search .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Search history tags */
#search-history-list > div {
    margin-bottom: 5px;
}

/* Export modal checkboxes */
.export-field {
    margin-right: 8px;
    cursor: pointer;
}

/* Status and type checkboxes */
.status-checkbox,
.type-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .quick-filters-section,
    .saved-searches-section,
    .advanced-filters-section,
    .search-history-section {
        padding: 15px;
    }
    
    .btn-quick-filter {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    #search .dashboard-header {
        flex-direction: column;
        gap: 10px;
    }
    
    #search .dashboard-header > div {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* END ADVANCED SEARCH & SAVED SEARCHES STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════ */
/* USER MANAGEMENT STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

/* Performance Table - General */
.performance-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.performance-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.performance-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.performance-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.performance-table tbody tr:hover {
    background-color: #f8f9fa;
}

.performance-table tbody td {
    padding: 12px 15px;
    font-size: 14px;
}

/* User Management Headings */
#user-management h2,
#user-management h3,
#user-management-content h2,
#user-management-content h3 {
    color: #667eea !important;
    font-weight: 600 !important;
}

/* Registered Users heading - specific override */
#user-management-content h2 {
    color: #667eea !important;
    margin-top: 0 !important;
}

/* User Management welcome text */
#user-management-content h3 {
    color: #2c3e50 !important;
}

/* User Management Content Container */
#user-management .dashboard-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#user-management h2:first-child,
#user-management h3:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#user-management-content {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    position: relative;
    background: white;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure user table stays within white area */
#user-management-content > div {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    position: relative;
    margin-top: 0;
}

/* Performance table in user management */
#user-management-content .performance-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    box-sizing: border-box;
}

/* Action buttons spacing in user table */
.performance-table td button {
    margin: 3px !important;
    white-space: nowrap;
}

/* Small buttons in action column */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    margin: 3px;
}

/* Ensure buttons don't wrap */
.performance-table td {
    white-space: nowrap;
}

/* User table action column */
.performance-table tbody td:last-child {
    min-width: 300px;
    padding: 8px;
}

/* Status badges */
.performance-table .status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

/* Button hover effects for user actions */
.performance-table .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Responsive table wrapper */
@media (max-width: 1200px) {
    #user-management-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .performance-table {
        min-width: 900px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* END USER MANAGEMENT STYLES */
/* ═══════════════════════════════════════════════════════════════════ */

/* ================================================================ */
/* USER MANAGEMENT - ENHANCED STYLES */
/* ================================================================ */

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Card Hover Effects */
.user-card {
    cursor: pointer;
}

/* Button Styles for User Management */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
}

/* Stats Cards Colors */
.stat-card.purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

/* Responsive adjustments for user management */
@media (max-width: 768px) {
    #user-management .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #user-management .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    #user-management .dashboard-header > div {
        width: 100%;
        display: flex;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    #user-management .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROLE-BASED PERMISSION STYLES - MAXIMUM SPECIFICITY
   ═══════════════════════════════════════════════════════════════════════════
   Disable and grey out admin-only buttons for restricted roles
   Officers can see what features exist but cannot use them
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-only-btn {
    /* Admin buttons visible by default */
    position: relative;
}

.admin-action {
    position: relative;
}

/* When body has restricted-user class, disable and grey out admin buttons */
/* Using multiple selectors for maximum specificity */
body.restricted-user .admin-only-btn,
body.restricted-user button.admin-only-btn,
body.restricted-user .btn.admin-only-btn {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #bdc3c7 !important;
    border-color: #95a5a6 !important;
    color: #7f8c8d !important;
    filter: grayscale(0.7) !important;
}

/* Admin-only sections in user cards */
body.restricted-user .admin-action,
body.restricted-user button.admin-action,
body.restricted-user .btn.admin-action {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #bdc3c7 !important;
    border-color: #95a5a6 !important;
    color: #7f8c8d !important;
    filter: grayscale(0.7) !important;
}

/* Add a visual indicator that the button is disabled */
body.restricted-user .admin-only-btn::after,
body.restricted-user .admin-action::after {
    content: ' 🔒';
    font-size: 0.75em;
    opacity: 0.6;
}

/* Tooltip on hover for disabled buttons */
body.restricted-user .admin-only-btn::before,
body.restricted-user .admin-action::before {
    content: 'Admin Only';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #2c3e50;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 1000;
}

body.restricted-user .admin-only-btn:hover::before,
body.restricted-user .admin-action:hover::before {
    opacity: 0.9;
}


/* ===================================================================
   MOBILE RESPONSIVE STYLES - REDMI NOTE 13 PRO & ALL MOBILES
   =================================================================== */

@media screen and (max-width: 1024px) {
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Header adjustments */
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-info {
        font-size: 12px;
        gap: 10px;
    }
    
    /* Hide tabs by default on mobile */
    .tabs {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 0 20px 0;
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        border-right: 2px solid #e1e8ed;
        border-bottom: none;
    }
    
    /* Show tabs when menu is open */
    .tabs.mobile-open {
        left: 0;
    }
    
    /* Overlay when menu is open */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    /* Tab buttons in mobile menu */
    .tab-btn {
        width: 100%;
        text-align: left;
        padding: 15px 25px;
        border-bottom: 1px solid #f0f0f0;
        border-left: 3px solid transparent;
    }
    
    .tab-btn.active {
        background: #f5f7fa;
        border-left: 3px solid #667eea;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .tab-btn:hover {
        background: #f8f9fa;
    }
    
    /* Adjust container for mobile */
    .container {
        border-radius: 0;
        min-height: 100vh;
        max-height: none;
        padding: 0;
    }
    
    body {
        padding: 0;
    }
    
    /* Tab content padding */
    .tab-content {
        padding: 15px;
    }
    
    /* Form adjustments */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Stats grid - 2 columns on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Tables - make scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 800px;
        font-size: 13px;
    }
    
    /* Buttons stack vertically */
    .button-group,
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Dashboard header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Extra small phones */
@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 16px;
    }
    
    .tabs {
        width: 250px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    table {
        font-size: 12px;
    }
}

/* Landscape mode for phones */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .tabs {
        padding-top: 60px;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* Tablet-specific adjustments (768px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Wider sidebar for tablets */
    .tabs {
        width: 320px;
    }
    
    /* Larger header text */
    .header h1 {
        font-size: 22px;
    }
    
    /* Stats grid - 3 columns on tablet */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Tablet-optimized spacing */
    .tab-content {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 32px;
    }
}
