:root {
    --primary: #ffd700;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #2a2a2a;
    --green: #4caf50;
    --blue: #2196f3;
    --red: #f44336;
    --orange: #ff9800;
    --purple: #9c27b0;
    --cyan: #00bcd4;
    --text: #fff;
    --text-muted: #888;
    --panel-width: 320px
}

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

body,
html {
    height: 100%;
    overflow-x: hidden
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-track {
    background: var(--bg-dark)
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px
}

.header {
    background: linear-gradient(180deg, #1a1a1a 0, #0a0a0a 100%);
    padding: 10px 20px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px
}

.header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(255, 215, 0, .5)
}

.header-company {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px var(--primary);
    border: 2px solid var(--primary);
    padding: 5px 20px;
    border-radius: 8px
}

.header-info {
    display: flex;
    gap: 10px
}

.info-box {
    background: rgba(255, 215, 0, .1);
    border: 2px solid var(--primary);
    padding: 8px 15px;
    border-radius: 8px;
    text-align: center;
    min-width: 100px
}

.info-box-label {
    font-size: .7rem;
    color: var(--text-muted)
}

.info-box-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary)
}

.stats-bar {
    background: var(--bg-card);
    padding: 5px 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid rgba(255, 215, 0, .3)
}

.stats-bar-title {
    width: 100%;
    text-align: center;
    font-size: .7rem;
    color: var(--primary);
    margin-bottom: 3px;
    font-weight: 600
}

.stat-card {
    background: rgba(255, 215, 0, .05);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 4px 10px;
    text-align: center;
    min-width: 70px;
    cursor: pointer;
    transition: all .3s;
    position: relative;
    overflow: hidden
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, .1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg)
    }

    100% {
        transform: translateX(100%) rotate(45deg)
    }
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, .3)
}

.stat-card.green {
    border-color: var(--green)
}

.stat-card.blue {
    border-color: var(--blue)
}

.stat-card.red {
    border-color: var(--red);
    animation: pulse-red 1s infinite
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 5px var(--red)
    }

    50% {
        box-shadow: 0 0 25px var(--red), 0 0 50px var(--red)
    }
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    position: relative;
    z-index: 1
}

.stat-card.green .stat-value {
    color: var(--green)
}

.stat-card.blue .stat-value {
    color: var(--blue)
}

.stat-card.red .stat-value {
    color: var(--red)
}

.stat-label {
    font-size: .6rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1
}

.visa-bar {
    background: rgba(0, 0, 0, .3);
    padding: 8px 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, .2)
}

.visa-card {
    background: var(--bg-input);
    border: 1px solid rgba(255, 215, 0, .5);
    border-radius: 6px;
    padding: 6px 12px;
    text-align: center;
    min-width: 80px
}

.visa-card-title {
    font-size: .7rem;
    color: var(--primary)
}

.visa-card-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff
}

.unified-stats-bar {
    background: linear-gradient(180deg, #1a1a1a 0, #0d0d0d 100%);
    padding: 5px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: 2px solid var(--primary)
}

.stats-group {
    display: flex;
    gap: 3px;
    align-items: center
}

.stats-divider {
    width: 2px;
    height: 30px;
    background: var(--primary);
    margin: 0 8px;
    opacity: .5
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all .2s
}

.mini-stat:hover {
    transform: scale(1.05)
}

.mini-stat:hover .mini-box {
    background: rgba(255, 215, 0, .15)
}

.mini-stat.green .mini-box {
    border-color: var(--green)
}

.mini-stat.blue .mini-box {
    border-color: var(--blue)
}

.mini-stat.red .mini-box {
    border-color: var(--red)
}

.mini-box {
    background: rgba(255, 215, 0, .05);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 4px;
    padding: 3px 8px;
    min-width: 35px;
    text-align: center
}

.mini-value {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2
}

.mini-stat.green .mini-value {
    color: var(--green)
}

.mini-stat.blue .mini-value {
    color: var(--blue)
}

.mini-stat.red .mini-value {
    color: var(--red)
}

.mini-label {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-bottom: 2px
}

.main-container {
    display: flex;
    min-height: calc(100vh - 180px)
}

.content-area {
    flex: 1;
    padding: 10px;
    overflow-y: auto
}

.parking-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px
}

.parking-section {
    flex: 1;
    margin-bottom: 0
}

.section-title {
    text-align: center;
    font-size: 1.1rem;
    color: var(--primary);
    padding: 10px;
    background: rgba(255, 215, 0, .1);
    border: 2px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, .5)
}

.parking-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 10px;
    background: rgba(0, 0, 0, .3);
    border-radius: 10px
}

.parking-grid.exit-grid {
    grid-template-columns: repeat(7, 1fr)
}

.parking-spot {
    width: 55px;
    height: 55px;
    aspect-ratio: 1/1;
    min-height: 55px;
    max-width: 55px;
    background: var(--bg-input);
    border: 3px solid #444;
    border-radius: 8px;
    padding: 5px;
    position: relative;
    cursor: pointer;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.parking-spot:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 215, 0, .6);
    z-index: 10
}

.parking-spot.early {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(76, 175, 80, .5)
}

.parking-spot.ontime {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    border-color: var(--blue);
    box-shadow: 0 0 15px rgba(33, 150, 243, .5)
}

.parking-spot.late {
    background: linear-gradient(135deg, #b71c1c, #d32f2f);
    border-color: var(--red);
    animation: spot-pulse .6s infinite
}

@keyframes spot-pulse {

    0%,
    100% {
        box-shadow: 0 0 15px var(--red);
        transform: scale(1)
    }

    50% {
        box-shadow: 0 0 40px var(--red), 0 0 60px rgba(244, 67, 54, .5);
        transform: scale(1.02)
    }
}

.parking-spot.empty {
    background: rgba(30, 30, 30, .6);
    border-color: #333;
    opacity: .5
}

.parking-spot.empty:hover {
    opacity: .8
}

.spot-number {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, .8);
    color: var(--primary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: .6rem;
    font-weight: 700;
    z-index: 2
}

.spot-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    font-size: .45rem;
    font-weight: 700;
    color: #fff;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2
}

.spot-badge.early {
    background: var(--green)
}

.spot-badge.ontime {
    background: var(--blue)
}

.spot-badge.late {
    background: var(--red)
}

.bus-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    margin-top: 14px;
    font-size: .5rem;
    color: #fff;
    overflow: hidden
}

.info-row {
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

.info-icon {
    font-size: .6rem
}

.countdown {
    text-align: center;
    font-size: .55rem;
    font-weight: 700;
    padding: 2px;
    background: rgba(0, 0, 0, .5);
    border-radius: 3px;
    margin-top: auto
}

.empty-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    font-size: 1.5rem
}

.gates-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, .3);
    border-radius: 10px;
    border: 2px solid var(--primary)
}

.gates-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px
}

.gate-box {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 10px;
    text-align: center
}

.gate-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px
}

.gate-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff
}

.control-panel {
    width: var(--panel-width);
    background: linear-gradient(180deg, #1a1a1a 0, #0d0d0d 100%);
    border-right: 3px solid var(--primary);
    padding: 15px;
    overflow-y: auto;
    transition: all .3s;
    position: relative;
    z-index: 100
}

.control-panel.hidden {
    width: 0;
    padding: 0;
    overflow: hidden
}

.panel-section {
    background: rgba(255, 215, 0, .03);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px
}

.panel-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, .3)
}

.panel-stat {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: .85rem
}

.panel-stat-value {
    color: var(--primary);
    font-weight: 700
}

.panel-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s;
    font-size: .85rem
}

.panel-btn.primary {
    background: linear-gradient(135deg, var(--primary), #ffed4e);
    color: #000
}

.panel-btn.success {
    background: linear-gradient(135deg, var(--green), #81c784);
    color: #fff
}

.panel-btn.danger {
    background: linear-gradient(135deg, var(--red), #e57373);
    color: #fff
}

.panel-btn.info {
    background: linear-gradient(135deg, var(--blue), #64b5f6);
    color: #fff
}

.panel-btn.warning {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: #000
}

.panel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, .4)
}

.panel-tabs {
    display: flex;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--primary)
}

.panel-tab {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: .7rem;
    color: var(--text-muted);
    transition: all .3s;
    border: none;
    background: 0 0
}

.panel-tab:hover {
    background: rgba(255, 215, 0, .1);
    color: var(--primary)
}

.panel-tab.active {
    background: var(--primary);
    color: #000;
    font-weight: 700
}

.tab-content {
    display: none
}

.tab-content.active {
    display: block
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 215, 0, .1)
}

.setting-label {
    font-size: .8rem;
    color: var(--text)
}

.setting-input {
    width: 80px;
    padding: 5px;
    background: var(--bg-input);
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: var(--primary);
    text-align: center;
    font-size: .85rem
}

.setting-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-input);
    border-radius: 13px;
    cursor: pointer;
    transition: all .3s;
    border: 1px solid #444
}

.setting-toggle.active {
    background: var(--green);
    border-color: var(--green)
}

.setting-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: all .3s
}

.setting-toggle.active::after {
    left: 27px
}

.color-picker {
    width: 40px;
    height: 30px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    padding: 0
}

.alerts-list {
    max-height: 300px;
    overflow-y: auto
}

.alert-item {
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: .75rem;
    border-right: 3px solid;
    background: rgba(0, 0, 0, .3)
}

.alert-item.critical {
    border-color: var(--red);
    background: rgba(244, 67, 54, .1)
}

.alert-item.warning {
    border-color: var(--orange);
    background: rgba(255, 152, 0, .1)
}

.alert-item.info {
    border-color: var(--blue);
    background: rgba(33, 150, 243, .1)
}

.alert-item.success {
    border-color: var(--green);
    background: rgba(76, 175, 80, .1)
}

.alert-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px
}

.alert-title {
    font-weight: 700
}

.alert-time {
    color: var(--text-muted);
    font-size: .65rem
}

.kpi-card {
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    text-align: center
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary)
}

.kpi-label {
    font-size: .7rem;
    color: var(--text-muted)
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .5s
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 80px;
    padding: 10px 0
}

.chart-bar {
    width: 30%;
    border-radius: 4px 4px 0 0;
    transition: height .5s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end
}

.chart-bar-label {
    font-size: .6rem;
    color: var(--text);
    margin-top: 5px
}

.form-list {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.form-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 6px;
    cursor: pointer;
    transition: all .3s
}

.form-item:hover {
    background: rgba(255, 215, 0, .1);
    border-color: var(--primary)
}

.form-icon {
    font-size: 1.2rem
}

.form-name {
    font-size: .8rem;
    font-weight: 600
}

.form-desc {
    font-size: .65rem;
    color: var(--text-muted)
}

.add-bus-section {
    background: rgba(0, 0, 0, .3);
    border: 1px dashed var(--primary);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px
}

.add-bus-input {
    width: 100%;
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--primary);
    border-radius: 4px;
    color: var(--text);
    margin-bottom: 8px;
    font-size: .85rem
}

.add-bus-input::placeholder {
    color: var(--text-muted)
}

.spot-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px
}

.spot-actions .panel-btn {
    flex: 1;
    padding: 6px;
    font-size: .75rem
}

.bus-list {
    max-height: 350px;
    overflow-y: auto
}

.bus-card {
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all .3s
}

.bus-card:hover {
    background: rgba(255, 215, 0, .1);
    border-color: var(--primary)
}

.bus-card.early {
    border-right: 3px solid var(--green)
}

.bus-card.ontime {
    border-right: 3px solid var(--blue)
}

.bus-card.late {
    border-right: 3px solid var(--red)
}

.bus-card.completed {
    border-right: 3px solid var(--green);
    background: rgba(76, 175, 80, .1)
}

.bus-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px
}

.bus-card-plate {
    font-weight: 700;
    color: var(--primary);
    font-size: .85rem
}

.bus-card-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .6rem;
    font-weight: 700
}

.bus-card-badge.early {
    background: var(--green);
    color: #fff
}

.bus-card-badge.ontime {
    background: var(--blue);
    color: #fff
}

.bus-card-badge.late {
    background: var(--red);
    color: #fff
}

.bus-card-badge.completed {
    background: var(--green);
    color: #fff
}

.bus-card-info {
    font-size: .7rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.bus-card-progress {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden
}

.bus-card-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width .3s
}

.forms-badges {
    display: flex;
    gap: 3px;
    margin-top: 5px
}

.form-badge {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .5rem;
    background: var(--bg-input);
    color: var(--text-muted)
}

.form-badge.completed {
    background: var(--green);
    color: #fff
}

.form-badge.pending {
    background: var(--orange);
    color: #fff
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000
}

.modal-overlay.active {
    display: flex
}

.modal {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 215, 0, .3)
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 2px solid var(--primary);
    background: rgba(255, 215, 0, .1)
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary)
}

.modal-close {
    background: 0 0;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all .3s
}

.modal-close:hover {
    color: var(--red)
}

.modal-body {
    padding: 15px
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid rgba(255, 215, 0, .3)
}

.modal-footer .panel-btn {
    margin-top: 0
}

.form-group {
    margin-bottom: 12px
}

.form-label {
    display: block;
    font-size: .8rem;
    color: var(--primary);
    margin-bottom: 5px;
    font-weight: 600
}

.form-label.required::after {
    content: ' *';
    color: var(--red)
}

.form-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 6px;
    color: var(--text);
    font-size: .9rem;
    transition: all .3s
}

.form-input:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 215, 0, .3)
}

.form-select {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 6px;
    color: var(--text);
    font-size: .9rem;
    cursor: pointer
}

.form-row {
    display: flex;
    gap: 10px
}

.form-row .form-group {
    flex: 1
}

.forms-menu {
    position: fixed;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 10px;
    width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .8);
    z-index: 2500;
    display: none
}

.forms-menu.active {
    display: block
}

.forms-menu-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--primary);
    padding: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, .3)
}

.forms-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .3s
}

.forms-menu-item:hover {
    background: rgba(255, 215, 0, .1)
}

.forms-menu-item-icon {
    font-size: 1.2rem
}

.forms-menu-item-name {
    font-size: .8rem;
    flex: 1
}

.forms-menu-item-status {
    font-size: .8rem
}

.gates-advanced {
    margin-top: 20px
}

.gate-section {
    background: rgba(0, 0, 0, .3);
    border: 2px solid var(--primary);
    border-radius: 10px;
    margin-bottom: 15px
}

.gate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 215, 0, .1);
    border-bottom: 1px solid var(--primary);
    border-radius: 8px 8px 0 0
}

.gate-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary)
}

.gate-stats-mini {
    display: flex;
    gap: 10px;
    font-size: .75rem
}

.gate-stats-mini span {
    padding: 2px 6px;
    border-radius: 4px
}

.gate-stats-mini .early {
    background: var(--green)
}

.gate-stats-mini .ontime {
    background: var(--blue)
}

.gate-stats-mini .late {
    background: var(--red)
}

.gate-buses-list {
    padding: 10px;
    max-height: 250px;
    overflow-y: auto
}

.gate-bus-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, .3);
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all .3s
}

.gate-bus-card:hover {
    background: rgba(255, 215, 0, .1);
    transform: translateX(-5px)
}

.gate-bus-card.early {
    border-right: 3px solid var(--green)
}

.gate-bus-card.ontime {
    border-right: 3px solid var(--blue)
}

.gate-bus-card.late {
    border-right: 3px solid var(--red);
    animation: pulse-red .7s infinite
}

.toggle-btn {
    position: fixed;
    top: 120px;
    left: var(--panel-width);
    background: var(--primary);
    color: #000;
    padding: 15px 8px;
    cursor: pointer;
    z-index: 1001;
    border-radius: 0 8px 8px 0;
    font-weight: 700;
    writing-mode: vertical-rl;
    transition: all .3s;
    font-size: .8rem;
    border: none
}

.toggle-btn:hover {
    padding-left: 15px
}

.toggle-btn.shifted {
    left: 0
}

.fullscreen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--primary);
    color: #000;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    z-index: 999;
    transition: all .3s
}

.fullscreen-btn:hover {
    transform: scale(1.1)
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px;
    background: rgba(0, 0, 0, .3);
    flex-wrap: wrap
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px
}

.legend-color.green {
    background: var(--green)
}

.legend-color.blue {
    background: var(--blue)
}

.legend-color.red {
    background: var(--red)
}

.legend-color.empty {
    background: #333;
    border: 1px solid #555
}

.footer {
    background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
    border-top: 3px solid var(--primary);
    padding: 10px;
    text-align: center;
    font-size: .8rem;
    color: var(--primary)
}

.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, .95);
    border: 2px solid var(--primary);
    padding: 12px;
    border-radius: 8px;
    pointer-events: none;
    z-index: 2000;
    display: none;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, .3)
}

.tooltip-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--primary)
}

.tooltip-row {
    font-size: .8rem;
    margin: 4px 0
}

.notifications {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 70vh;
    overflow-y: auto
}

.notification {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: .85rem;
    animation: slideIn .4s ease;
    border-right: 4px solid;
    backdrop-filter: blur(10px);
    min-width: 280px
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

.notification.success {
    background: rgba(76, 175, 80, .2);
    border-color: var(--green)
}

.notification.warning {
    background: rgba(255, 152, 0, .2);
    border-color: var(--orange)
}

.notification.error {
    background: rgba(244, 67, 54, .2);
    border-color: var(--red)
}

.notification.info {
    background: rgba(33, 150, 243, .2);
    border-color: var(--blue)
}

@media (max-width:1200px) {
    .parking-grid {
        grid-template-columns: repeat(7, 1fr)
    }

    .parking-grid.exit-grid {
        grid-template-columns: repeat(9, 1fr)
    }

    .gates-grid {
        grid-template-columns: repeat(5, 1fr)
    }
}

@media (max-width:768px) {
    .header {
        flex-direction: column;
        text-align: center
    }

    .control-panel {
        width: 100%;
        position: fixed;
        bottom: 0;
        height: 50vh
    }

    .parking-grid {
        grid-template-columns: repeat(4, 1fr)
    }

    .parking-grid.exit-grid {
        grid-template-columns: repeat(5, 1fr)
    }
}

/* ═══════════════ شريط التبويبات الرئيسي ═══════════════ */
.main-tabs-bar {
    width: 100%;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-bottom: 2px solid var(--primary);
    padding: 8px 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.main-tabs-container {
    display: flex;
    gap: 10px;
}

.main-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.main-tab:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.main-tab.active {
    background: var(--primary);
    color: #000;
}

.main-tab-icon {
    font-size: 1.2rem;
}

.main-tab-text {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ═══════════════ قسم المطور ═══════════════ */
.dev-section {
    display: none;
    width: 100%;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
    border-bottom: 3px solid var(--primary);
    animation: slideDown 0.3s ease;
}

.dev-section.active {
    display: block;
}

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

.dev-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.dev-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.dev-section-close {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--red);
    color: var(--red);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dev-section-close:hover {
    background: var(--red);
    color: #fff;
}

.dev-section-content {
    padding: 20px;
    min-height: 200px;
}

.dev-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    border: 2px dashed rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 1rem;
}

.dev-placeholder-hint {
    font-size: 0.8rem;
    margin-top: 8px;
    color: var(--primary);
    opacity: 0.7;
}

/* ═══════════════ مربعات قسم المطور - متوافق مع جميع المتصفحات ═══════════════ */
.dev-spots-container {
    display: -webkit-box;      /* Safari 3.1-6, iOS 6-, Android 2.1-4.3 */
    display: -webkit-flex;     /* Safari 6.1+, iOS 7+, Chrome 21-28 */
    display: -ms-flexbox;      /* IE 10 */
    display: flex;
    -webkit-box-pack: center;  /* Safari 3.1-6 */
    -webkit-justify-content: center;
    -ms-flex-pack: center;     /* IE 10 */
    justify-content: center;
    -webkit-box-align: center; /* Safari 3.1-6 */
    -webkit-align-items: center;
    -ms-flex-align: center;    /* IE 10 */
    align-items: center;
    padding: 20px;
}

.dev-spot {
    width: 55px;
    height: 55px;
    background: #2a2a2a;
    background: var(--bg-input, #2a2a2a); /* fallback للمتصفحات القديمة */
    border: 3px solid #444;
    -webkit-border-radius: 8px;
    border-radius: 8px;
    margin: 0 5px; /* بديل gap للتوافق الكامل */
}

/* ═══════════════ التجاوب - تابلت ═══════════════ */
@media (max-width: 768px) {
    .dev-spots-container {
        padding: 15px;
    }
    .dev-spot {
        width: 50px;
        height: 50px;
    }
}

/* ═══════════════ التجاوب - جوال ═══════════════ */
@media (max-width: 480px) {
    .dev-spots-container {
        padding: 10px;
    }
    .dev-spot {
        width: 45px;
        height: 45px;
        margin: 0 4px;
    }
}