:root {
    --bg-color: #f1f5f9;
    --panel-bg: #ffffff;
    --border-color: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    
    --success: #16a34a;
    --danger: #dc2626;
    
    --header-bg: #e2e8f0;
}

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

body {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    height: 40px;
    background: #1e293b;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}
.logo { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.toolbar-info { display: flex; gap: 15px; font-size: 12px; font-weight: 500; }

/* Layout Grid */
.desktop-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 4px;
    padding: 4px;
    background: var(--border-color);
    overflow: hidden;
}

/* Panels */
.panel {
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.panel-header {
    background: var(--header-bg);
    padding: 6px 10px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #0f172a;
}

/* Tabs */
.tabs { display: flex; gap: 4px; }
.tab-btn { padding: 4px 12px; border: 1px solid #94a3b8; border-radius: 4px; background: #f1f5f9; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

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

/* Forms & Inputs (Dense) */
.dense-form .form-row { margin-bottom: 8px; }
.dense-form label { display: block; font-weight: 500; margin-bottom: 3px; font-size: 12px; color: var(--text-secondary); }
.input-group { display: flex; gap: 4px; }
.input-group input, .input-group select { flex: 1; min-width: 0; }

input[type="text"], select {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }
select[multiple] { height: 80px; }

/* Buttons */
.btn {
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; border-color: #94a3b8; color: var(--text-primary); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 15px; }

/* Settings Area */
.settings-box { border: 1px solid var(--border-color); border-radius: 3px; background: #fafafa; }
.box-title { padding: 4px 8px; background: #f1f5f9; border-bottom: 1px solid var(--border-color); font-weight: 500; font-size: 11px; color: var(--text-secondary); text-transform: uppercase; }
.mini-form { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border-color); }
.mini-list { list-style: none; max-height: 120px; overflow-y: auto; }
.mini-list li { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid #e2e8f0; font-size: 12px; }
.mini-list li:last-child { border-bottom: none; }
.btn-icon-small { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0 4px; }

/* Ramps Grid (Center) */
.ramps-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}
.ramps-main-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
}
.ramps-inactive-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: 90px;
}
.ramp-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.ramp-card.inactive { background: #f8fafc; border-color: #cbd5e1; opacity: 0.7; }
.ramp-card.waiting { border-top: 4px solid #facc15; }
.ramp-card.loading { border-top: 4px solid #4ade80; background: #f0fdf4; }
.ramp-card.reserved { border-top: 4px solid #6366f1; background: #e0e7ff; }

/* İnaktif rampalar için dikey yön değişikliği */
.ramps-inactive-row .ramp-card .ramp-num-area { font-size: 12px; }
.ramps-inactive-row .ramp-card { flex-direction: column-reverse; }

.ramp-num-area {
    background: var(--header-bg);
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.ramp-body {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.truck-data { display: flex; flex-direction: column; gap: 4px; }
.r-plate { font-size: 16px; font-weight: 700; color: #0f172a; }
.r-driver { font-size: 12px; color: var(--text-secondary); }
.r-dest { font-size: 12px; font-weight: 500; color: #334155; }
.r-type { font-size: 10px; padding: 1px 4px; background: #ef4444; color: white; border-radius: 2px; align-self: flex-start;}

.ramp-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 100px;
}
.status-text { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.waiting .status-text { color: #b45309; }
.loading .status-text { color: #15803d; }
.reserved .status-text { color: #4338ca; }
.r-time { font-family: monospace; font-size: 15px; font-weight: 700; }

.empty-msg { color: #94a3b8; font-style: italic; }

/* Data Tables (Right Panel) */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; font-weight: 600; text-align: left; padding: 6px; border-bottom: 2px solid var(--border-color); font-size: 11px; text-transform: uppercase; color: var(--text-secondary); position: sticky; top: 0; }
.data-table td { padding: 6px; border-bottom: 1px solid #e2e8f0; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:hover { background: #f1f5f9; }

.q-plate { font-weight: 700; color: #0f172a; }
.q-sub { font-size: 11px; color: var(--text-secondary); }
.q-type { color: var(--danger); font-size: 10px; border: 1px solid var(--danger); border-radius: 2px; padding: 0 2px;}

.action-buttons { display: flex; gap: 2px; flex-wrap: wrap; }
.btn-tiny {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}
.btn-tiny:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-del { color: var(--danger); border-color: #fca5a5; }
.btn-del:hover { background: var(--danger); color: white; }

.history-area { height: 35%; overflow-y: auto; border-top: 4px solid var(--border-color); }
.queue-area { height: 65%; overflow-y: auto; }

/* Ekip gruplandırma renkleri */
.ramp-card[data-team="1"] .ramp-num-area { background: #dbeafe; color: #1e40af; }
.ramp-card[data-team="2"] .ramp-num-area { background: #ede9fe; color: #5b21b6; }

/* Yükleniyor animasyonu */
@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.ramp-card.loading .r-time { animation: loadingPulse 2s ease-in-out infinite; color: #15803d; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Tır Görsel Tasarımı (Dikey / Yukarı Bakan) */
.truck-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    margin-top: 5px;
    position: relative;
}

.truck-cabin {
    width: 60%;
    height: 40px;
    background: #0ea5e9;
    border-radius: 12px 12px 0 0;
    position: relative;
    border: 2px solid #0284c7;
    z-index: 2;
    margin-bottom: 2px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Ön cam */
.truck-window {
    position: absolute;
    top: 6px;
    left: 10%;
    width: 80%;
    height: 10px;
    background: #bae6fd;
    border-radius: 6px 6px 2px 2px;
    border: 1px solid #7dd3fc;
}

.truck-trailer {
    width: 85%;
    flex: 1;
    min-height: 100px;
    background-color: #f8fafc;
    border: 2px solid #475569;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}

.truck-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 2px dashed #94a3b8;
    padding: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    word-break: break-word;
    position: relative;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.02) 10px, rgba(0,0,0,0.02) 20px);
}
.truck-section:last-child {
    border-bottom: none;
}
.section-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #ef4444;
    color: white;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Premium Modal Styles */
.premium-modal .modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    font-family: inherit;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.premium-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.premium-modal .modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.premium-modal h3 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
}

.premium-modal p.desc {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    margin-top: 0;
}

.premium-modal .form-group {
    margin-bottom: 28px;
}

.premium-modal label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.select-card {
    flex: 1 1 calc(50% - 5px);
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
}

.select-card i {
    font-size: 16px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.select-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.select-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.select-card.active i {
    color: #3b82f6;
}

/* EMAS variant card active state */
.modal-emas .select-card.active {
    border-color: #db2777;
    background: #fdf2f8;
    color: #9d174d;
    box-shadow: 0 4px 6px -1px rgba(219, 39, 119, 0.1);
}

.modal-emas .select-card.active i {
    color: #db2777;
}

.premium-modal .btn-group {
    display: flex;
    gap: 12px;
}

.premium-modal .btn-confirm {
    flex: 1.5;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
}

.premium-modal .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.1);
}

.premium-modal .btn-cancel {
    flex: 1;
    background: #f1f5f9;
    color: #475569;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.premium-modal .btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Modal Overlay backdrop filter */
.modal-overlay.premium-blur {
    backdrop-filter: blur(6px);
    background: rgba(15, 23, 42, 0.65);
}

/* EMAS Variant */
.modal-emas .modal-icon { background: #fce7f3; color: #db2777; }
.modal-emas .btn-confirm { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); box-shadow: 0 4px 6px -1px rgba(190, 24, 93, 0.2); }
.modal-emas .btn-confirm:hover { box-shadow: 0 10px 15px -3px rgba(190, 24, 93, 0.3); }
.modal-emas .premium-select:focus { border-color: #db2777; box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.15); }
