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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar - Sophos XG Style */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a2332 0%, #0f1419 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.logo h2 {
    color: #00b8d4;
    font-size: 22px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #b8c5d6;
    text-decoration: none;
    transition: all 0.3s;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(0,184,212,0.15);
    color: #00b8d4;
    border-right-color: #00b8d4;
}

.nav-item .icon {
    font-size: 20px;
    margin-left: 12px;
    width: 24px;
}

.nav-sub-item {
    padding-right: 40px;
    font-size: 14px;
    background: rgba(0,0,0,0.1);
}

.nav-sub-item .icon {
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header h1 {
    font-size: 24px;
    color: #1a2332;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
    position: relative;
}

.user-profile:hover {
    background: #f0f0f0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b8d4, #0097a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* User Menu */
.user-menu {
    position: absolute;
    top: 60px;
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

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

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 8px;
}

.user-menu-item:hover {
    background: #f8f9fa;
}

.user-menu-item span:first-child {
    font-size: 18px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 13px;
    transition: all 0.3s;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9e9e9e;
    animation: pulse 2s infinite;
}

.connection-status.connected .status-dot {
    background: #4caf50;
}

.connection-status.disconnected .status-dot {
    background: #f44336;
    animation: none;
}

.connection-status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.connection-status.disconnected {
    background: #ffebee;
    color: #c62828;
}

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

/* Pages */
.page {
    display: none;
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.page.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card.clickable {
    cursor: pointer;
    position: relative;
}

.stat-card.clickable::after {
    content: '→';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.stat-card.clickable:hover::after {
    color: rgba(0,0,0,0.5);
    left: 10px;
}

.stat-card.clickable:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.stat-card.clickable:active {
    transform: translateY(-4px);
}

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

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

.stat-icon.blue { background: linear-gradient(135deg, #00b8d4, #0097a7); }
.stat-icon.purple { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }
.stat-icon.green { background: linear-gradient(135deg, #4caf50, #388e3c); }
.stat-icon.cyan { background: linear-gradient(135deg, #00bcd4, #0097a7); }
.stat-icon.orange { background: linear-gradient(135deg, #ff9800, #f57c00); }
.stat-icon.success { background: linear-gradient(135deg, #66bb6a, #43a047); }
.stat-icon.warning { background: linear-gradient(135deg, #ffa726, #fb8c00); }
.stat-icon.red { background: linear-gradient(135deg, #f44336, #d32f2f); }

.stat-info h3 {
    font-size: 32px;
    color: #1a2332;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Card */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    margin-bottom: 20px;
    color: #1a2332;
    font-size: 18px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: #1a2332;
    border-bottom: 2px solid #e0e0e0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badge */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status.working {
    background: #e8f5e9;
    color: #4caf50;
}

.status.maintenance {
    background: #fff3e0;
    color: #ff9800;
}

.status.broken {
    background: #ffebee;
    color: #f44336;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #00b8d4, #0097a7);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,184,212,0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 16px;
}

.btn-action:hover {
    background: #f0f0f0;
}

/* Page Actions */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 300px;
    font-size: 14px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

#item-form {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1a2332;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Reports */
.reports-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #00b8d4, #0097a7);
    color: white;
    border-radius: 12px;
}

.reports-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.reports-header p {
    margin: 0;
    opacity: 0.9;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    text-align: center;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 184, 212, 0.2);
    border-color: #00b8d4;
}

.report-card .report-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.report-card h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
}

.report-card p {
    margin: 0 0 15px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.report-card .report-stats {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #00b8d4;
}

.report-card.maintenance-card .report-stats.warning {
    background: #fff3cd;
    color: #856404;
}

.report-card.status-card .report-stats {
    color: #6c757d;
}

/* Report Modal */
.report-modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
}

.report-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #00b8d4, #0097a7);
    color: white;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-preview-header h2 {
    margin: 0;
    font-size: 24px;
}

.report-preview-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.report-preview-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.report-actions {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 80px;
    z-index: 9;
}

.report-preview-content {
    padding: 30px;
}

/* Report Content Styles */
.report-header {
    text-align: center;
    padding: 20px;
    border-bottom: 3px solid #00b8d4;
    margin-bottom: 30px;
}

.report-logo h1 {
    color: #00b8d4;
    margin: 0 0 10px 0;
    font-size: 32px;
}

.report-date {
    color: #7f8c8d;
    font-size: 14px;
}

.report-section {
    margin-bottom: 40px;
}

.report-section h3 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.report-section h4 {
    color: #34495e;
    font-size: 18px;
    margin: 25px 0 15px 0;
}

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

.stat-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #00b8d4;
    margin-bottom: 5px;
}

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

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.report-table thead {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.report-table th {
    padding: 12px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

.report-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

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

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

.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

.no-data.success {
    color: #27ae60;
    font-weight: bold;
}

.maintenance-summary {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

.maintenance-stat {
    background: white;
    padding: 20px 40px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.maintenance-stat.warning {
    border-color: #ffc107;
    background: #fff3cd;
}

.maintenance-stat.danger {
    border-color: #dc3545;
    background: #f8d7da;
}

.maintenance-stat strong {
    display: block;
    font-size: 36px;
    margin-bottom: 5px;
}

.maintenance-stat.warning strong {
    color: #856404;
}

.maintenance-stat.danger strong {
    color: #721c24;
}

.maintenance-stat span {
    font-size: 14px;
    color: #666;
}

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

.status-card-report {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-card-report.working {
    border-color: #27ae60;
    background: #d4edda;
}

.status-card-report.maintenance {
    border-color: #ffc107;
    background: #fff3cd;
}

.status-card-report.broken {
    border-color: #dc3545;
    background: #f8d7da;
}

.status-card-report .status-icon {
    font-size: 48px;
}

.status-card-report .status-info {
    flex: 1;
}

.status-card-report .status-count {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.status-card-report.working .status-count {
    color: #155724;
}

.status-card-report.maintenance .status-count {
    color: #856404;
}

.status-card-report.broken .status-count {
    color: #721c24;
}

.status-card-report .status-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.status-card-report .status-percent {
    font-size: 18px;
    font-weight: bold;
    opacity: 0.7;
}

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

.audit-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

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

.audit-stat-card.total {
    border-color: #00b8d4;
    background: linear-gradient(135deg, #e0f7fa, #ffffff);
}

.audit-stat-card.create {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d4edda, #ffffff);
}

.audit-stat-card.update {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffffff);
}

.audit-stat-card.delete {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #ffffff);
}

.audit-stat-card .stat-icon {
    font-size: 48px;
    opacity: 0.8;
}

.audit-stat-card .stat-info {
    flex: 1;
}

.audit-stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.audit-stat-card.total .stat-value {
    color: #00b8d4;
}

.audit-stat-card.create .stat-value {
    color: #27ae60;
}

.audit-stat-card.update .stat-value {
    color: #f39c12;
}

.audit-stat-card.delete .stat-value {
    color: #dc3545;
}

.audit-stat-card .stat-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Activity by Table */
.audit-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.activity-table-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

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

.activity-table-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.activity-total {
    background: #00b8d4;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.activity-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-bar-item {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 10px;
}

.activity-label {
    font-size: 13px;
    color: #666;
}

.activity-bar {
    background: #e0e0e0;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.activity-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 12px;
}

.activity-bar-fill.create {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.activity-bar-fill.update {
    background: linear-gradient(90deg, #f39c12, #ffc107);
}

.activity-bar-fill.delete {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.activity-count {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    margin: 0;
}

.card-header .page-actions {
    margin: 0;
}

/* Audit Details */
.audit-details {
    padding: 20px;
}

.audit-info-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 2px solid #e0e0e0;
}

.audit-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.audit-info-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

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

/* Audit Comparison */
.audit-comparison {
    margin: 25px 0;
}

.audit-comparison h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.audit-changes-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audit-change-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
}

.audit-change-label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
}

.audit-change-values {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
}

.audit-old-value,
.audit-new-value {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.audit-old-value {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
}

.audit-new-value {
    background: #d4edda;
    border: 2px solid #c3e6cb;
}

.change-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
}

.change-badge.old {
    background: #dc3545;
    color: white;
}

.change-badge.new {
    background: #28a745;
    color: white;
}

.audit-arrow {
    font-size: 24px;
    color: #00b8d4;
    font-weight: bold;
}

/* Audit Data Grid */
.audit-data {
    margin: 20px 0;
}

.audit-data h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.audit-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.audit-field {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.audit-field-label {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 5px;
}

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

/* Expandable Details */
.audit-details-section {
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.audit-details-section summary {
    background: #f8f9fa;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    user-select: none;
}

.audit-details-section summary:hover {
    background: #e9ecef;
}

.audit-details-section[open] summary {
    background: #00b8d4;
    color: white;
}

.audit-details-section .audit-data-grid {
    margin: 15px;
}

.audit-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.audit-info p {
    margin: 8px 0;
    font-size: 14px;
}

.audit-data pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #e0e0e0;
}

/* Print Styles */
@media print {
    /* Hide unnecessary elements */
    .report-preview-header,
    .report-actions,
    .sidebar,
    .header,
    .close-btn {
        display: none !important;
    }
    
    /* Full width for content */
    .report-modal-content {
        max-width: 100%;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .report-preview-content {
        padding: 20px;
    }
    
    /* Better page breaks */
    .report-section {
        page-break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .report-table {
        page-break-inside: auto;
    }
    
    .report-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    .report-table thead {
        display: table-header-group;
    }
    
    /* Better colors for print */
    .report-table thead {
        background: #34495e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .status-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .stat-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Add header to each page */
    @page {
        margin: 2cm;
    }
    
    /* Report header */
    .report-header {
        page-break-after: avoid;
    }
}

/* Chart */
#chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: #1a2332;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

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

/* Notification Badge */
.btn-icon {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Settings Page */
.settings-section {
    margin-top: 20px;
}

.settings-section h4 {
    color: #1a2332;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.setting-info {
    flex: 1;
}

.setting-info strong {
    display: block;
    color: #1a2332;
    margin-bottom: 5px;
}

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

.setting-item button {
    margin-right: 20px;
}

/* Tabs */
.tabs-container {
    width: 100%;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 15px;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #00b8d4;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #00b8d4;
    border-bottom-color: #00b8d4;
    background: #f8f9fa;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        right: -260px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s ease;
    }
    
    .sidebar.active {
        right: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .user-profile span {
        display: none;
    }
    
    .connection-status {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .status-text {
        display: none;
    }
    
    .page {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .stat-info h3 {
        font-size: 24px;
    }
    
    .stat-info p {
        font-size: 13px;
    }
    
    .page-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-actions .btn-primary,
    .page-actions .search-input {
        width: 100%;
    }
    
    .card {
        padding: 15px;
        overflow-x: auto;
    }
    
    table {
        min-width: 800px;
        font-size: 13px;
    }
    
    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    #item-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .report-card {
        padding: 20px;
    }
    
    .report-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .report-preview-header {
        padding: 15px 20px;
    }
    
    .report-preview-header h2 {
        font-size: 18px;
    }
    
    .report-actions {
        padding: 15px;
        flex-direction: column;
    }
    
    .report-actions .btn {
        width: 100%;
    }
    
    .report-preview-content {
        padding: 15px;
    }
    
    .report-table {
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .status-summary {
        grid-template-columns: 1fr;
    }
    
    .maintenance-summary {
        flex-direction: column;
    }
    
    .maintenance-stat {
        padding: 15px 30px;
    }
    
    .audit-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-stat-card {
        padding: 20px;
    }
    
    .audit-stat-card .stat-icon {
        font-size: 36px;
    }
    
    .audit-stat-card .stat-value {
        font-size: 28px;
    }
    
    .audit-activity-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-bar-item {
        grid-template-columns: 70px 1fr 35px;
        gap: 8px;
    }
    
    .activity-label {
        font-size: 12px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .page-actions {
        width: 100%;
    }
    
    .audit-info-header {
        grid-template-columns: 1fr;
    }
    
    .audit-change-values {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .audit-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
    
    .audit-data-grid {
        grid-template-columns: 1fr;
    }
    }
    
    .tabs {
        overflow-x: auto;
        gap: 5px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
    }
    
    .btn-icon {
        font-size: 18px;
        padding: 6px;
    }
    
    .avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .btn-action {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .status {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting-item button {
        width: 100%;
        margin-right: 0;
        margin-top: 10px;
    }
}

/* ============================================
   تنسيقات الطباعة (Professional Print CSS)
   ============================================ */
@media print {
    /* تهيئة الصفحة وجعل الخلفية بيضاء تماماً */
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* إخفاء القوائم الجانبية والأزرار والإشعارات والفوتر */
    .sidebar,
    .header,
    .sidebar-overlay,
    .page-actions,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-action,
    .close-btn,
    .report-actions,
    .toast-container,
    #confirm-overlay,
    #toast-container {
        display: none !important;
    }
    
    /* عرض الحاوية الرئيسية بكامل العرض */
    .container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* تهيئة نافذة عرض التقرير المنبثقة للطباعة مباشرة */
    .modal {
        position: relative !important;
        display: block !important;
        background: none !important;
        z-index: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .modal-content {
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .report-preview-header {
        background: none !important;
        color: black !important;
        border-bottom: 2px solid #333 !important;
        padding: 10px 0 !important;
        position: relative !important;
        top: 0 !important;
    }

    .report-preview-header h2 {
        color: black !important;
    }

    .report-preview-content {
        padding: 10px 0 !important;
    }

    /* تنسيق الجداول لتناسب أوراق A4 للطباعة */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }
    
    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }
    
    thead {
        display: table-header-group !important;
    }
    
    th, td {
        border: 1px solid #999 !important;
        color: black !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
        text-align: right !important;
    }
    
    th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
    }
}

