/* Core System Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #0a0f1d;
    --bg-card: rgba(15, 23, 42, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #16a34a; /* Corporate Green */
    --primary-glow: rgba(22, 163, 74, 0.3);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --dark-accent: #0f172a;
    --header-green: #15803d; /* Solid Title Green */
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: auto;
    background-image: 
        radial-gradient(at 10% 20%, rgba(22, 163, 74, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background-color: rgba(10, 15, 30, 0.85);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.parking-icon {
    font-size: 1.75rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.logo span span {
    color: var(--success);
    text-shadow: 0 0 8px var(--success-glow);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.8s infinite;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #a7f3d0;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px var(--success); }
    100% { transform: scale(0.9); opacity: 0.6; }
}

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

.role-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.role-selector-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.role-icon {
    color: var(--primary);
    font-size: 0.9rem;
}

.role-dropdown {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 0.5rem;
}

.role-dropdown option {
    background-color: #0c1122;
    color: var(--text-primary);
}

/* Dashboard Container */
.dashboard-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
}

/* Cards & Layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-green); /* Solid Corporate Green */
    color: white;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.card-header h3 i {
    color: white;
}

.card-body {
    padding: 1.5rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Row 1 Layout */
.visuals-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .visuals-row {
        grid-template-columns: 1fr;
    }
}

/* Schematic SVG Design */
.schematic-wrapper {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #060913;
}

.schematic-svg {
    width: 100%;
    max-height: 420px;
}

.hw-node rect {
    fill: #111827;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.hw-node .box-text {
    text-anchor: middle;
    fill: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.hw-node .box-text.title {
    font-size: 13px;
    font-weight: 600;
}

.hw-node .box-text.title-large {
    font-size: 15px;
    font-weight: 700;
    fill: #93c5fd;
}

.hw-node .box-text.subtitle {
    font-size: 10px;
    fill: var(--text-secondary);
}

.hw-node .box-text.subtitle-large {
    font-size: 12px;
    fill: #d1d5db;
}

.hw-node .box-text.status-state {
    font-size: 11px;
    fill: var(--warning);
    font-weight: 600;
}

/* Highlighting Active Nodes in Diagram */
.hw-node.active rect {
    stroke: var(--success);
    fill: rgba(16, 185, 129, 0.08);
    filter: drop-shadow(0 0 8px var(--success-glow));
}

.hw-node.highlight rect.main-controller {
    stroke: var(--primary);
    fill: rgba(59, 130, 246, 0.1);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.hw-node.active-denied rect {
    stroke: var(--danger);
    fill: rgba(239, 68, 68, 0.08);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

/* Data Links and Pulsing Flows */
.data-link {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.link-label {
    font-size: 10px;
    font-family: 'Fira Code', monospace;
    font-weight: 500;
}

.link-label.blue { fill: #93c5fd; }
.link-label.orange { fill: #fdba74; }
.link-label.green { fill: #6ee7b7; }

/* Pulse animation on pathways */
.data-link.pulse {
    stroke-dasharray: 8 6;
    animation: flowPulse 1s linear infinite;
    stroke-width: 3px;
}

.link-ethernet.pulse { stroke: #3b82f6; }
.link-rs232.pulse { stroke: #f59e0b; }
.link-rs485.pulse { stroke: #3b82f6; }
.link-gpio.pulse { stroke: #10b981; }
.link-relay.pulse { stroke: #10b981; }
.link-loop.pulse { stroke: #f59e0b; }

@keyframes flowPulse {
    to {
        stroke-dashoffset: -28;
    }
}

/* Gate Visualizer Widget */
.gate-visualizer-container {
    height: 100%;
    min-height: 380px;
    background-color: #0c1122;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.sky-bg {
    flex: 1;
    background: linear-gradient(180deg, #090e1f 0%, #111827 100%);
    border-radius: 8px;
    position: relative;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 2rem;
}

/* Simulated Barrier */
.gate-structure {
    width: 240px;
    height: 150px;
    position: relative;
    margin-right: 40px;
}

.gate-pillar {
    width: 30px;
    height: 100px;
    background: linear-gradient(90deg, #374151 0%, #1f2937 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    left: 20px;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 5;
}

.gate-boom-arm {
    width: 200px;
    height: 14px;
    position: absolute;
    bottom: 75px;
    left: 35px;
    transform-origin: 10px 7px;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.gate-boom-arm.closed {
    transform: rotate(0deg);
}

.gate-boom-arm.open {
    transform: rotate(-85deg);
}

.gate-boom-arm .stripes {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        #f59e0b,
        #f59e0b 12px,
        #111 12px,
        #111 24px
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.gate-light-pole {
    width: 4px;
    height: 120px;
    background: #4b5563;
    position: absolute;
    bottom: 0;
    left: 45px;
    z-index: 2;
}

.gate-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    position: absolute;
    top: -15px;
    left: -6px;
    border: 2px solid #1f2937;
    background-color: #ef4444;
    box-shadow: 0 0 15px #ef4444;
    transition: all 0.3s ease;
}

.gate-light.green {
    background-color: #10b981;
    box-shadow: 0 0 15px #10b981;
}

.ground-loop-visual {
    width: 160px;
    height: 25px;
    border: 3px dashed rgba(245, 158, 11, 0.3);
    position: absolute;
    bottom: 5px;
    right: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ground-loop-visual.active {
    border-color: var(--warning);
    background-color: rgba(245, 158, 11, 0.08);
    box-shadow: 0 0 10px var(--warning-glow);
}

.loop-text {
    font-size: 7px;
    font-weight: 700;
    color: rgba(245, 158, 11, 0.5);
    letter-spacing: 1px;
}

.ground-loop-visual.active .loop-text {
    color: var(--warning);
}

/* LED Matrix Screen UI */
.display-box-screen {
    background-color: #000;
    border: 3px solid #1f2937;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.led-dot-matrix {
    font-family: 'Fira Code', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    color: #06b6d4;
    text-shadow: 0 0 6px rgba(6, 182, 212, 0.8);
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.led-dot-matrix.access-granted {
    color: #10b981;
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.led-dot-matrix.access-denied {
    color: #ef4444;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* Badge Status in Card Headers */
.gate-status-badge {
    padding: 0.35rem 0.85rem;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.gate-status-badge.closed { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.gate-status-badge.opening { background-color: rgba(245, 158, 11, 0.15); color: #fdba74; border: 1px solid rgba(245, 158, 11, 0.3); }
.gate-status-badge.open { background-color: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.gate-status-badge.closing { background-color: rgba(245, 158, 11, 0.15); color: #fdba74; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Grid Layout Rows */
.grid-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
}

.grid-layout.flex-columns {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1024px) {
    .grid-layout, .grid-layout.flex-columns {
        grid-template-columns: 1fr;
    }
}

/* Control Panel Forms */
.sim-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

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

.form-group label i {
    color: var(--primary);
    margin-right: 0.25rem;
}

/* Radio Toggles */
.radio-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--dark-accent);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: 6px;
}

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

.radio-toggle label {
    text-align: center;
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.radio-toggle input[type="radio"]:checked + label {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Form Inputs */
select, input[type="text"], input[type="number"] {
    width: 100%;
    background-color: var(--dark-accent);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-divider {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.2);
    letter-spacing: 1.5px;
    margin: 0.5rem 0;
    position: relative;
}

.form-divider::before, .form-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 20%;
    height: 1px;
    background-color: rgba(255,255,255,0.08);
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.flex-full {
    grid-column: span 2;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border: none;
    padding: 0.85rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.2);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}
.btn-clear:hover { color: var(--danger); }

/* Retro Terminal logs */
.bus-card {
    height: 100%;
}

.terminal-body {
    background-color: #030712;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-top: 1px solid var(--border-color);
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.8);
}

.terminal-line {
    word-break: break-all;
    line-height: 1.4;
}

.terminal-line .timestamp {
    color: #6b7280;
    margin-right: 0.5rem;
}

.terminal-line.system { color: #9ca3af; }
.terminal-line.rx { color: #f97316; } /* Serial incoming packet */
.terminal-line.tx { color: #3b82f6; } /* Modbus outgoing display */
.terminal-line.net { color: #10b981; } /* TCP Camera stream */
.terminal-line.error { color: #ef4444; }

/* Tables Grid styling */
.table-card {
    grid-column: span 1;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 350px;
    border-top: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

/* Ensure tables are scrollable on smaller viewports (Android/iPad/PC) instead of getting squished */
#logs-table, #vehicle-table, #reports-output-table, #reports-table-element {
    min-width: 950px;
}

#users-list-table, #locations-list-table, #devices-list-table {
    min-width: 750px;
}

#gates-list-table, #vtypes-list-table, #tariffs-list-table {
    min-width: 550px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

td .v-type-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

td .v-type-badge.regular { background-color: rgba(59, 130, 246, 0.15); color: #93c5fd; }
td .v-type-badge.vip { background-color: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
td .v-type-badge.guest { background-color: rgba(245, 158, 11, 0.15); color: #fdba74; }

td .status-log-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

td .status-log-badge.active { background-color: rgba(245, 158, 11, 0.15); color: #fdba74; }
td .status-log-badge.completed { background-color: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-btn {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover { color: white; }

.modal-card form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Camera Screen Animations */
@keyframes scanAnim {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

@keyframes flashEffect {
    0% { background-color: rgba(255, 255, 255, 0.8); }
    100% { background-color: #020617; }
}

.camera-flash {
    animation: flashEffect 0.5s ease-out;
}

@keyframes blink {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.red-blink {
    animation: blink 1.2s infinite;
    color: var(--danger) !important;
}

/* User Profile Card Styles */
.profile-card {
    background-color: var(--dark-accent);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.profile-row {
    color: var(--text-primary);
}

.profile-row strong {
    color: var(--text-secondary);
}

/* Connection Active State Pulse */
.conn-state.connected .conn-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--success);
    animation: pulse 1.5s infinite;
}

.conn-state.disconnected .conn-dot {
    width: 6px;
    height: 6px;
    background-color: var(--danger);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--danger);
}

.conn-state.disconnected {
    color: var(--danger) !important;
}

/* Print Media Styles for clean receipt/invoice printing */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .navbar, 
    .shortcut-help-footer, 
    .export-actions, 
    .filter-toolbar, 
    .visuals-row, 
    .grid-layout, 
    .modal-overlay, 
    .reports-card .card-header button,
    #admin-view-group > section:not(.reports-card) {
        display: none !important;
    }
    .reports-card {
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    .reports-card .table-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    th, td {
        border: 1px solid #000 !important;
        color: #000 !important;
        padding: 8px !important;
        font-size: 10pt !important;
        background: white !important;
    }
    #print-header-display, 
    #print-footer-display {
        display: block !important;
        color: black !important;
    }
    
    /* Receipt Print Isolation Rules */
    body.printing-receipt #admin-view-group,
    body.printing-receipt #user-portal-section,
    body.printing-receipt .navbar,
    body.printing-receipt .shortcut-help-footer,
    body.printing-receipt .modal-overlay:not(#receipt-modal),
    body.printing-receipt .modal-card:not(#receipt-modal .modal-card) {
        display: none !important;
    }
    
    body.printing-receipt #receipt-modal {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        display: block !important;
    }
    body.printing-receipt #receipt-modal .modal-card {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }
    body.printing-receipt #receipt-modal .modal-header,
    body.printing-receipt #receipt-modal label,
    body.printing-receipt #receipt-modal select,
    body.printing-receipt #receipt-modal button {
        display: none !important;
    }
    body.printing-receipt .receipt-slip-wrapper {
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
}

/* POS Receipt styling */
#receipt-slip-preview {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    line-height: 1.4;
    color: black;
    background: white;
}
.receipt-pos-80 {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
}
.receipt-pos-58 {
    width: 58mm;
    max-width: 100%;
    margin: 0 auto;
    font-size: 9px !important;
}
.receipt-pos-a4 {
    width: 100%;
    font-size: 12px;
}
.receipt-divider {
    border-top: 1px dashed black;
    margin: 8px 0;
}
.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}
.receipt-header h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}
.receipt-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}
.receipt-row.total {
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}
.receipt-barcode {
    text-align: center;
    margin-top: 15px;
    letter-spacing: 4px;
    font-size: 10px;
    color: #444;
}

/* Admin Console Tabs CSS Styling */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.admin-tab-content {
    display: none;
    animation: fadeInTab 0.3s ease-in-out;
}
.admin-tab-content.active {
    display: block;
}
@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Speed Selection Buttons inside Form Fields */
.speed-select-buttons {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
    flex-wrap: wrap;
}
.speed-btn {
    background-color: var(--dark-accent);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.speed-btn:hover {
    color: white;
    background-color: var(--border-color);
    transform: translateY(-1px);
}

/* Color Coding by Button Click Target Values */
.speed-btn[onclick*="Car"] { border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }
.speed-btn[onclick*="Two-Wheeler"] { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.speed-btn[onclick*="Auto"] { border-color: rgba(249, 115, 22, 0.4); color: #fdba74; }
.speed-btn[onclick*="Taxi"] { border-color: rgba(251, 191, 36, 0.4); color: #fde047; }
.speed-btn[onclick*="Mini Bus"] { border-color: rgba(168, 85, 247, 0.4); color: #c084fc; }

.speed-btn[onclick*="FASTAG"] { border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }
.speed-btn[onclick*="CASH"] { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.speed-btn[onclick*="ONLINE"] { border-color: rgba(168, 85, 247, 0.4); color: #c084fc; }

.speed-btn[onclick*="REGULAR"] { border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }
.speed-btn[onclick*="STAFF"] { border-color: rgba(249, 115, 22, 0.4); color: #fdba74; }
.speed-btn[onclick*="EXEMPTED"] { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.speed-btn[onclick*="MONTHLY_PASS"] { border-color: rgba(251, 191, 36, 0.4); color: #fde047; }

/* Glowing shadows when selected */
.speed-btn[onclick*="Car"].selected, .speed-btn[onclick*="REGULAR"].selected, .speed-btn[onclick*="FASTAG"].selected {
    background-color: var(--primary) !important; color: white !important; border-color: var(--primary) !important; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}
.speed-btn[onclick*="Two-Wheeler"].selected, .speed-btn[onclick*="EXEMPTED"].selected, .speed-btn[onclick*="CASH"].selected {
    background-color: var(--success) !important; color: white !important; border-color: var(--success) !important; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.speed-btn[onclick*="Auto"].selected, .speed-btn[onclick*="STAFF"].selected {
    background-color: #f97316 !important; color: white !important; border-color: #f97316 !important; box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}
.speed-btn[onclick*="Taxi"].selected, .speed-btn[onclick*="MONTHLY_PASS"].selected {
    background-color: #f59e0b !important; color: white !important; border-color: #f59e0b !important; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.speed-btn[onclick*="Mini Bus"].selected, .speed-btn[onclick*="ONLINE"].selected {
    background-color: #8b5cf6 !important; color: white !important; border-color: #8b5cf6 !important; box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Custom Scrollbars to prevent scroll hijacking - Bold and easy to grab */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid transparent;
    background-clip: padding-box;
}

/* Allow parent document to scroll naturally once boundary is hit */
.table-wrapper, .terminal-body, div[style*="overflow: auto"], div[style*="overflow-y: auto"] {
    overscroll-behavior: auto;
}

/* Operations Grid Pills Styling (uploaded layout) */
.ops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1.25rem 0;
}

.pill-btn {
    background-color: rgba(22, 163, 74, 0.04);
    border: 1.5px solid rgba(22, 163, 74, 0.25);
    color: #4ade80;
    padding: 0.45rem 0.75rem;
    border-radius: 50px; /* Pill shape */
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.pill-btn:hover {
    background-color: rgba(22, 163, 74, 0.15);
    border-color: #22c55e;
    color: white;
    transform: translateY(-1px);
}

/* Ticket Info Action Row Buttons */
.ticket-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-pay {
    flex: 1.2;
    background-color: #16a34a;
    color: white;
    border: none;
    padding: 0.65rem 1rem;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}
.btn-pay:hover {
    background-color: #15803d;
}

.btn-refresh {
    flex: 1;
    background-color: #991b1b;
    color: white;
    border: none;
    padding: 0.65rem 1rem;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}
.btn-refresh:hover {
    background-color: #7f1d1d;
}

.btn-reprint {
    flex: 1;
    background-color: #db2777;
    color: white;
    border: none;
    padding: 0.65rem 1rem;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
    box-shadow: 0 4px 10px rgba(219, 39, 119, 0.2);
}
.btn-reprint:hover {
    background-color: #be185d;
}

/* Form inline grids */
.inline-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}
.inline-form-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 110px;
}
.inline-form-row input, .inline-form-row select {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 4px;
    background-color: var(--dark-accent);
    color: white;
    border: 1px solid var(--border-color);
}
.inline-form-row input:disabled {
    opacity: 0.75;
    background-color: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.05);
}

/* Device Status indicators (uploaded layout) */
.device-status-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}
.device-status-item span.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef4444; /* Default offline */
    box-shadow: 0 0 6px #ef4444;
}
.device-status-item span.status-dot.online {
    background-color: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

/* Access Park Premium Tab Style Rules */
.nav-tab-btn:hover {
    color: white !important;
}

.pill-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.reports-subtabs .subtab-btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}

.reports-subtabs .subtab-btn.active {
    background-color: var(--dark-accent) !important;
    color: white !important;
    border: 1px solid var(--primary) !important;
}

/* Styled scrollbar for card wrappers */
.table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Highlight style for dynamic metrics table */
#reports-output-table th {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
}

#reports-output-table td {
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.65rem 0.75rem;
}

#reports-output-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}
