/* STCI Client Portal Styles */

:root {
    --primary-green: #1a5d1a;
    --primary-green-light: #2f8f2d;
    --secondary-green: #e8f5e9;
    --danger-red: #dc3545;
    --warning-orange: #ff9800;
    --warning-yellow: #ffc107;
    --info-blue: #17a2b8;
    --text-dark: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
    --white: #fff;
}

/* Header Navigation */
.portal-header {
    background: var(--primary-green);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.portal-header .logo {
    color: var(--white);
    font-weight: bold;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-header .logo span {
    background: var(--white);
    color: var(--primary-green);
    padding: 2px 8px;
    border-radius: 4px;
}

.portal-nav {
    display: flex;
    gap: 5px;
}

.portal-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.portal-nav a:hover,
.portal-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.portal-user {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-user a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.portal-user a:hover {
    color: var(--white);
}

.portal-user .btn-back-home {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.portal-user .btn-back-home:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mobile-menu-toggle.active {
    background: rgba(255, 255, 255, 0.25);
}

/* Main Content */
.portal-main {
    padding: 20px 30px;
    background: var(--bg-light);
    min-height: calc(100vh - 60px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter-group {
    display: flex;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.date-filter-group button {
    border: none;
    background: transparent;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s;
}

.date-filter-group button.active,
.date-filter-group button:hover {
    background: var(--primary-green);
    color: var(--white);
}

/* Custom Date Range */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.custom-date-range .date-input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

.custom-date-range .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-file-complaint {
    background: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.btn-file-complaint:hover {
    background: var(--primary-green-light);
}

/* Tab Navigation */
.portal-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--secondary-green);
    padding: 5px;
    border-radius: 8px;
    width: fit-content;
}

.portal-tabs button {
    border: none;
    background: transparent;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: all 0.3s;
}

.portal-tabs button.active {
    background: var(--primary-green);
    color: var(--white);
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-card .stat-value.split {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-card .stat-value .open {
    color: var(--primary-green);
}

.stat-card .stat-value .closed {
    color: var(--text-muted);
}

.stat-card .stat-value .divider {
    color: var(--border-color);
    font-weight: 300;
}

.severity-badges {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.severity-badge {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
}

.severity-badge.critical {
    background: var(--danger-red);
}

.severity-badge.high {
    background: var(--warning-orange);
}

.severity-badge.medium {
    background: var(--warning-yellow);
    color: var(--text-dark);
}

.severity-badge.low {
    background: var(--primary-green);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Cards */
.portal-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.portal-card .card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
    background: var(--bg-light);
}

.portal-card .card-body {
    padding: 20px;
}

/* Tickets Table */
.tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.tickets-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.tickets-table tr:last-child td {
    border-bottom: none;
}

.tickets-table tr:hover {
    background: var(--bg-light);
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.in-review {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.pending-client {
    background: #fff8e1;
    color: #ffa000;
}

.status-badge.resolved {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.closed {
    background: #f5f5f5;
    color: #757575;
}

.status-badge.pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.confirmed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.cancelled {
    background: #ffebee;
    color: #c62828;
}

.status-badge.completed {
    background: #e3f2fd;
    color: #1565c0;
}

/* Severity Indicators */
.severity-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.severity-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.severity-indicator.critical .dot {
    background: var(--danger-red);
}

.severity-indicator.high .dot {
    background: var(--warning-orange);
}

.severity-indicator.medium .dot {
    background: var(--warning-yellow);
}

.severity-indicator.low .dot {
    background: var(--primary-green);
}

/* SLA Time */
.sla-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sla-time.warning {
    color: var(--warning-orange);
}

.sla-time.danger {
    color: var(--danger-red);
}

/* Action Buttons */
.btn-view {
    background: var(--secondary-green);
    color: var(--primary-green);
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view:hover {
    background: var(--primary-green);
    color: var(--white);
}

/* Active Issues Section */
.issues-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.circuit-bar {
    margin-bottom: 10px;
}

.circuit-bar .bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.circuit-bar .bar-track {
    height: 24px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.circuit-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
}

.circuit-bar .bar-fill.green {
    background: var(--primary-green);
}

.circuit-bar .bar-fill.orange {
    background: var(--warning-orange);
}

.circuit-bar .bar-fill.red {
    background: var(--danger-red);
}

.circuit-bar .bar-fill.yellow {
    background: var(--warning-yellow);
    color: var(--text-dark);
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Chart Container */
.chart-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    align-items: center;
    gap: 30px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Repeat Incidents */
.repeat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.repeat-item:last-child {
    border-bottom: none;
}

.repeat-item .icon {
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.repeat-item .info {
    flex: 1;
}

.repeat-item .info strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.repeat-item .info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== FILE A COMPLAINT MODAL ===== */
.complaint-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.complaint-modal-overlay.active {
    display: flex;
}

.complaint-modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.complaint-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.complaint-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.complaint-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.complaint-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.complaint-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--primary-green);
    color: var(--white);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-dark);
    font-weight: 500;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 10px;
}

.step-connector.completed {
    background: var(--primary-green);
}

/* Incident Type Tiles */
.incident-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.incident-tile {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.incident-tile:hover {
    border-color: var(--primary-green);
    background: var(--secondary-green);
}

.incident-tile.selected {
    border-color: var(--primary-green);
    background: var(--secondary-green);
}

.incident-tile .tile-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.incident-tile.selected .tile-icon {
    background: var(--primary-green);
    color: var(--white);
}

.incident-tile h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.incident-tile p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group label .required {
    color: var(--danger-red);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

/* Multi-select Tags */
.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-option {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag-option:hover,
.tag-option.selected {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

/* Severity Selector */
.severity-selector {
    display: flex;
    gap: 10px;
}

.severity-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.severity-option:hover {
    border-color: var(--primary-green);
}

.severity-option.selected {
    border-width: 2px;
}

.severity-option.critical.selected {
    border-color: var(--danger-red);
    background: #ffebee;
}

.severity-option.high.selected {
    border-color: var(--warning-orange);
    background: #fff3e0;
}

.severity-option.medium.selected {
    border-color: var(--warning-yellow);
    background: #fffde7;
}

.severity-option.low.selected {
    border-color: var(--primary-green);
    background: var(--secondary-green);
}

.severity-option .severity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 auto 8px;
}

.severity-option.critical .severity-dot {
    background: var(--danger-red);
}

.severity-option.high .severity-dot {
    background: var(--warning-orange);
}

.severity-option.medium .severity-dot {
    background: var(--warning-yellow);
}

.severity-option.low .severity-dot {
    background: var(--primary-green);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-green);
}

.toggle-switch input:checked+.toggle-slider::after {
    transform: translateX(20px);
}

/* Alert Box */
.alert-box {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-box.warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert-box.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* Dynamic Panel */
.dynamic-panel {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.dynamic-panel h3 {
    margin: 0 0 15px;
    font-size: 1rem;
    color: var(--text-dark);
}

/* Minutes Calculator */
.minutes-calculated {
    background: var(--secondary-green);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
}

.minutes-calculated .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
}

.minutes-calculated .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-green);
    background: var(--secondary-green);
}

.file-upload-area i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.file-upload-area p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-green-light);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-danger {
    background: var(--danger-red);
    color: var(--white);
}

/* Hidden Steps */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* ===== COMPLAINT DETAILS POPUP ===== */
.complaint-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 18px;
}

.detail-section-full {
    grid-column: 1 / -1;
}

.detail-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a5d1a;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 120px;
}

.detail-value {
    font-size: 0.82rem;
    color: #212529;
    text-align: right;
    word-break: break-word;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.detail-tag {
    background: #e8f5e9;
    color: #1a5d1a;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 600px) {
    .complaint-details-grid {
        grid-template-columns: 1fr;
    }

    .detail-label {
        min-width: 100px;
    }
}

/* ===== RESPONSIVE STYLES ===== */

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .portal-main {
        padding: 20px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .incident-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .portal-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-green);
        flex-direction: column;
        padding: 10px 15px;
        gap: 5px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .portal-nav.active {
        display: flex;
    }

    .portal-nav a {
        padding: 12px 15px;
        border-radius: 5px;
        font-size: 0.9rem;
    }

    .portal-nav a:hover,
    .portal-nav a.active {
        background: rgba(255, 255, 255, 0.2);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .chart-container {
        flex-direction: column;
        gap: 20px;
    }

    .chart-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* Small Tablets and Large Phones */
@media (max-width: 768px) {

    /* Header */
    .portal-header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
        gap: 10px;
        position: relative;
    }

    .portal-header .logo {
        font-size: 1rem;
        flex: 1;
    }

    .portal-user {
        order: 2;
        gap: 10px;
        font-size: 0.85rem;
    }

    .mobile-menu-toggle {
        order: 1;
    }

    .portal-user .btn-back-home {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .portal-user .btn-back-home span {
        display: none;
    }

    .portal-user .user-welcome {
        display: none;
    }

    .portal-user .logout-link {
        font-size: 0.8rem;
    }

    /* Main Content */
    .portal-main {
        padding: 15px;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    /* Stats */
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .severity-badges {
        flex-wrap: wrap;
    }

    .severity-badge {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    /* Tabs */
    .portal-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .portal-tabs button {
        padding: 8px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Date Filters */
    .date-filter-group {
        width: 100%;
    }

    .date-filter-group button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .custom-date-range {
        width: 100%;
        flex-wrap: wrap;
    }

    .custom-date-range .date-input {
        flex: 1;
        min-width: 120px;
    }

    /* Tables */
    .tickets-table {
        font-size: 0.8rem;
    }

    .tickets-table th,
    .tickets-table td {
        padding: 8px 5px;
    }

    .tickets-table th {
        font-size: 0.65rem;
    }

    /* Hide some columns on mobile */
    .tickets-table th:nth-child(4),
    .tickets-table td:nth-child(4),
    .tickets-table th:nth-child(5),
    .tickets-table td:nth-child(5) {
        display: none;
    }

    .btn-view {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .status-badge {
        padding: 3px 6px;
        font-size: 0.65rem;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-row.three-cols {
        grid-template-columns: 1fr;
    }

    .incident-tiles {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .incident-tile {
        padding: 15px 10px;
    }

    .incident-tile .tile-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .incident-tile h4 {
        font-size: 0.85rem;
    }

    .incident-tile p {
        font-size: 0.65rem;
    }

    /* Severity Selector */
    .severity-selector {
        flex-wrap: wrap;
    }

    .severity-option {
        flex: 1 1 45%;
        padding: 12px;
    }

    .severity-option strong {
        font-size: 0.85rem;
    }

    .severity-option small {
        font-size: 0.65rem;
    }

    /* Modals */
    .complaint-modal {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }

    .complaint-modal-header {
        padding: 15px;
    }

    .complaint-modal-header h2 {
        font-size: 1.1rem;
    }

    .complaint-modal-body {
        padding: 15px;
    }

    .complaint-modal-footer {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .complaint-modal-footer .btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }

    /* Step Indicator */
    .step-indicator {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .step-label {
        font-size: 0.7rem;
        text-align: center;
    }

    .step-connector {
        width: 30px;
        display: none;
    }

    /* Cards */
    .portal-card .card-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .portal-card .card-body {
        padding: 15px;
    }

    /* Circuit Bars */
    .circuit-bar .bar-fill {
        font-size: 0.65rem;
        padding-left: 5px;
    }

    /* Repeat Items */
    .repeat-item {
        padding: 10px 0;
    }

    .repeat-item .icon {
        width: 32px;
        height: 32px;
    }

    .repeat-item .info strong {
        font-size: 0.85rem;
    }

    .repeat-item .info span {
        font-size: 0.75rem;
    }

    /* Bookings */
    #bookings-table th:nth-child(3),
    #bookings-table td:nth-child(3),
    #bookings-table th:nth-child(4),
    #bookings-table td:nth-child(4) {
        display: none;
    }

    /* Bookings section mobile adjustments */
    .booking-filters {
        flex-direction: column;
        align-items: stretch !important;
    }

    .booking-filters select {
        width: 100% !important;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .portal-header {
        padding: 8px 10px;
    }

    .portal-header .logo {
        font-size: 0.9rem;
    }

    .portal-header .logo span {
        padding: 1px 5px;
    }

    .mobile-menu-toggle {
        padding: 6px 10px;
        font-size: 1.1rem;
    }

    .portal-user {
        gap: 8px;
    }

    .portal-user .btn-back-home {
        padding: 5px 8px;
    }

    .portal-user .btn-back-home i {
        font-size: 1rem;
    }

    .portal-nav a {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .portal-main {
        padding: 10px;
    }

    .page-header h1 {
        font-size: 1.1rem;
    }

    .btn-file-complaint {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Stats - Single Column */
    .stats-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .stat-card .stat-label {
        margin-bottom: 0;
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    /* Incident Tiles - Single Column */
    .incident-tiles {
        grid-template-columns: 1fr;
    }

    .incident-tile {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 12px;
    }

    .incident-tile .tile-icon {
        margin: 0;
        flex-shrink: 0;
    }

    .incident-tile h4 {
        margin-bottom: 2px;
    }

    /* Tables - Card Style */
    .table-responsive-cards .tickets-table,
    .table-responsive-cards .tickets-table thead,
    .table-responsive-cards .tickets-table tbody,
    .table-responsive-cards .tickets-table th,
    .table-responsive-cards .tickets-table td,
    .table-responsive-cards .tickets-table tr {
        display: block;
    }

    .tickets-table thead {
        display: none;
    }

    .tickets-table tr {
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        background: var(--white);
    }

    .tickets-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .tickets-table td:last-child {
        border-bottom: none;
    }

    .tickets-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    /* Show all columns on mobile card view */
    .tickets-table th:nth-child(4),
    .tickets-table td:nth-child(4),
    .tickets-table th:nth-child(5),
    .tickets-table td:nth-child(5) {
        display: flex;
    }

    /* Severity Selector - 2x2 Grid */
    .severity-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .severity-option {
        padding: 10px;
    }

    /* Modal Footer */
    .complaint-modal-footer {
        flex-direction: column;
    }

    .complaint-modal-footer .btn {
        width: 100%;
    }

    .complaint-modal-footer>div {
        display: none;
    }

    /* Checkbox Groups */
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }

    /* Multi-select Tags */
    .multi-select-tags {
        gap: 6px;
    }

    .tag-option {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    /* File Upload */
    .file-upload-area {
        padding: 20px;
    }

    .file-upload-area i {
        font-size: 1.5rem;
    }

    .file-upload-area p {
        font-size: 0.8rem;
    }

    /* Booking Details Modal */
    #booking-details-content>div {
        grid-template-columns: 1fr !important;
    }

    /* Bookings table card view on mobile */
    #bookings-table thead {
        display: none;
    }

    #bookings-table tr {
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        background: var(--white);
        display: block;
    }

    #bookings-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
    }

    #bookings-table td:last-child {
        border-bottom: none;
        flex-wrap: wrap;
        gap: 5px;
    }

    #bookings-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    /* Show all booking columns on mobile card view */
    #bookings-table th:nth-child(3),
    #bookings-table td:nth-child(3),
    #bookings-table th:nth-child(4),
    #bookings-table td:nth-child(4) {
        display: flex;
    }

    #bookings-table .btn-view {
        margin-left: 0 !important;
        margin-top: 5px;
    }

    /* Chart */
    #categoryChart {
        max-width: 150px;
        max-height: 150px;
    }

    .chart-legend {
        justify-content: center;
    }

    .legend-item {
        font-size: 0.75rem;
    }
}

/* Extra Small Phones */
@media (max-width: 360px) {
    .portal-header .logo span {
        font-size: 0.8rem;
    }

    .portal-nav a {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-card .stat-value {
        font-size: 1rem;
    }

    .btn-file-complaint {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .btn-file-complaint i {
        display: none;
    }
}

/* Landscape Mode on Phones */
@media (max-width: 768px) and (orientation: landscape) {
    .complaint-modal {
        max-height: 98vh;
    }

    .complaint-modal-body {
        max-height: 50vh;
        overflow-y: auto;
    }

    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .incident-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    .btn-view,
    .btn,
    .portal-nav a,
    .portal-tabs button,
    .date-filter-group button,
    .incident-tile,
    .severity-option,
    .tag-option {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .incident-tile {
        justify-content: flex-start;
    }

    .checkbox-item label,
    .toggle-switch {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ============================================================
   HOTEL VOUCHER — Booking Details Modal
   ============================================================ */
/* ============================================================
   HOTEL VOUCHER — redesigned
   ============================================================ */
.hotel-voucher {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #212529;
    background: #fff;
    border: 1px solid #dde5db;
    border-radius: 8px;
    overflow: hidden;
    max-width: 800px;
}

/* ── Header ── */
.hv-head {
    border-top: 4px solid #2f8f2d;
    padding: 16px 24px 0;
    background: #fff;
}

.hv-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #2b4a2b;
}

.hv-brand {
    display: flex;
    align-items: center;
}

.hv-logo {
    height: 52px;
    width: auto;
    display: block;
    padding: 5px;
}

.hv-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.hv-head-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e8e8e8;
    padding: 10px 0 14px;
    font-size: 0.88rem;
    color: #333;
}

.hv-guest-label {
    color: #333;
}

.hv-ref-block {
    display: flex;
    gap: 22px;
    font-size: 0.85rem;
    color: #333;
}

/* ── Hotel Info ── */
.hv-hotel-section {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid #eaeaea;
}

.hv-hotel-img {
    width: 155px;
    height: 115px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.hv-hotel-img-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    font-size: 2.5rem;
    color: #aaa;
}

.hv-hotel-text {
    flex: 1;
    min-width: 0;
}

.hv-hotel-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2a5c28;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.hv-stars {
    color: #d4a017;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.hv-hotel-city {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
    font-style: italic;
}

.hv-hotel-addr,
.hv-hotel-tel {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.8;
    display: flex;
    align-items: center;
    gap: 7px;
}

.hv-hotel-addr i,
.hv-hotel-tel i {
    color: #2f8f2d;
    font-size: 0.88rem;
    flex-shrink: 0;
}

/* ── Timeline ── */
.hv-timeline {
    padding: 15px 25px;
    border-bottom: 1px solid #eaeaea;
}

.hv-timeline-section {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f4f6f3;
    padding: 5px 10px;
    border-radius: 5px;
}

.hv-tl-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 130px;
}

.hv-tl-col.hv-tl-right {
    align-items: flex-end;
}

.hv-tl-label {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 4px;
}

.hv-tl-date {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
    line-height: 1.2;
}

.hv-tl-time {
    font-size: 0.75rem;
    color: #777;
    margin-top: 4px;
}

.hv-tl-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px;
}

.hv-tl-connector {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 5px 0;
}

.hv-tl-dot {
    width: 10px;
    height: 10px;
    background: #2f8f2d;
    border-radius: 50%;
    flex-shrink: 0;
}

.hv-tl-line {
    flex: 1;
    height: 2px;
    background: #2f8f2d;
}

.hv-tl-night-badge {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111;
    line-height: 1.2;
}

/* ── Section wrapper ── */
.hv-section {
    padding: 20px 24px;
}

.hv-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #2a5c28;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid #2f8f2d;
    padding-left: 10px;
    margin-bottom: 14px;
}

/* ── Booking Details Grid ── */
.hv-bd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hv-bd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f8f6;
    border: 1px solid #e4e9e3;
    border-radius: 6px;
    padding: 10px 14px;
}

.hv-bd-item i {
    font-size: 1.3rem;
    color: #2f8f2d;
    flex-shrink: 0;
}

.hv-bd-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hv-bd-label {
    font-size: 0.68rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hv-bd-value {
    font-size: 0.87rem;
    color: #1a1a1a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Payment Due ── */
.hv-payment {
    border-top: 1px solid #eaeaea;
    background: #fafaf9;
}

.hv-payment-body {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.hv-payment-left {
    flex: 1;
}

.hv-payment-amount {
    font-size: 0.92rem;
    color: #333;
    margin-bottom: 12px;
}

.hv-payment-amount strong {
    font-size: 1.25rem;
    color: #1a1a1a;
}

.hv-payment-notes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hv-payment-notes li {
    font-size: 0.80rem;
    color: #555;
    padding: 3px 0 3px 20px;
    position: relative;
    line-height: 1.5;
}

.hv-payment-notes li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2f8f2d;
    font-weight: 700;
}

.hv-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e4e9e3;
    border-radius: 6px;
    padding: 10px;
}

.hv-qr-canvas {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hv-qr-canvas img,
.hv-qr-canvas canvas {
    width: 110px !important;
    height: 110px !important;
    display: block;
}

.hv-qr-label {
    font-size: 0.68rem;
    color: #555;
    text-align: center;
    line-height: 1.4;
}

/* ── Travel Services Footer ── */
.hv-travel-footer {
    background: #2b4a2b;
    color: #e0eee0;
}

.hv-tf-inner {
    padding: 18px 24px 14px;
}

.hv-tf-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.hv-tf-sub {
    font-size: 0.82rem;
    color: #c5dec5;
    margin: 0 0 10px 0;
}

.hv-tf-sub strong {
    color: #e0eee0;
}

.hv-tf-services {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}

.hv-tf-services li {
    font-size: 0.82rem;
    color: #d8ead8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hv-tf-services li i {
    color: #7ec87e;
    font-size: 0.85rem;
}

.hv-contact-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: #1c321c;
    padding: 10px 24px;
    font-size: 0.82rem;
    color: #c5dec5;
    flex-wrap: wrap;
}

.hv-contact-bar i {
    margin-right: 5px;
    color: #7ec87e;
}

/* Print button */
#print-voucher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Print styles */
@media print {
    .hotel-voucher {
        border: none;
    }
}

/* Responsive voucher */
@media (max-width: 640px) {
    .hv-head-top {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .hv-head-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .hv-ref-block {
        flex-direction: column;
        gap: 2px;
    }

    .hv-hotel-section {
        flex-direction: column;
    }

    .hv-hotel-img {
        width: 100%;
        height: 160px;
    }

    .hv-timeline {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .hv-tl-col.hv-tl-right {
        align-items: flex-start;
    }

    .hv-tl-mid {
        flex-direction: row;
        padding: 0;
        gap: 8px;
        align-items: center;
    }

    .hv-tl-connector {
        flex: 1;
    }

    .hv-bd-grid {
        grid-template-columns: 1fr;
    }

    .hv-payment-body {
        flex-direction: column;
    }

    .hv-contact-bar {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================================
   TABLE PAGINATION
   ============================================================ */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid #e9ecef;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 10px;
}

.pag-info {
    font-size: 0.82rem;
    color: #6c757d;
}

.pag-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-size: 0.83rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.pag-btn:hover:not(:disabled):not(.active) {
    background: #f0f7f0;
    border-color: #1a5d1a;
    color: #1a5d1a;
}

.pag-btn.active {
    background: #1a5d1a;
    border-color: #1a5d1a;
    color: #fff;
    font-weight: 700;
    cursor: default;
}

.pag-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.pag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    font-size: 0.83rem;
    color: #6c757d;
    user-select: none;
}
}