:root {
    --orange: #F58220;
    --orange-light: #ff9a47;
    --orange-dark: #d96d0f;
    --blue: #0078C8;
    --blue-light: #00AEEF;
    --blue-dark: #004A99;
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-elevated: #1c2330;
    --bg-input: #0d1117;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-dim: #6e7681;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --info: #58a6ff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,.4);
    --sidebar-width: 280px;
    --transition: .2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

a { color: var(--blue-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1f2e 50%, var(--bg-dark) 100%);
    padding: 1.5rem 1rem;
}

.auth-shell,
.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
}

.auth-logo {
    display: block;
    max-width: 320px;
    width: 100%;
    margin: 0 auto 2rem;
    filter: brightness(0) invert(1);
}

.auth-card h2 {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--text);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
    margin-bottom: 1.75rem;
}

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    max-width: min(var(--sidebar-width), 88vw);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 150;
    opacity: 0;
    transition: opacity var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(245,130,32,.08) 0%, transparent 100%);
}

.sidebar-logo {
    width: 100%;
    max-height: 64px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: .9375rem;
    margin-bottom: .25rem;
    transition: all var(--transition);
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(245,130,32,.15), rgba(0,120,200,.1));
    color: var(--orange);
    border-left: 3px solid var(--orange);
}

.nav-icon { font-size: 1.125rem; width: 1.5rem; text-align: center; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-details { min-width: 0; }
.user-details strong { display: block; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-details small { color: var(--text-muted); font-size: .75rem; display: block; }

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    padding: .5rem .75rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.page-heading {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    flex-shrink: 0;
}

.topbar-date { color: var(--text-muted); font-size: .875rem; white-space: nowrap; }

.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
}

/* Cards & Grid */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orange), var(--blue));
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--orange), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: .8125rem;
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
    color: var(--text);
}

.form-label .required { color: var(--orange); }

.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.form-control {
    width: 100%;
    padding: .625rem .875rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(245,130,32,.15);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control { cursor: pointer; }

textarea.form-control { min-height: 100px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-form .form-group:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: flex-end;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--orange);
    cursor: pointer;
}

.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-elevated);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--orange);
    background: rgba(245,130,32,.05);
}

.file-upload-area input[type="file"] { display: none; }

.file-upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }

.file-preview {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.file-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.file-preview-item img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.file-preview-item .file-name {
    font-size: .6875rem;
    padding: .25rem;
    background: var(--bg-card);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,130,32,.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--blue-light), var(--blue));
    color: #fff;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover { filter: brightness(1.1); color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { filter: brightness(1.1); color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    text-align: left;
    padding: .75rem 1rem;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,.02); }

.table-actions { display: flex; gap: .375rem; flex-wrap: wrap; }

/* Badges */
.badge {
    display: inline-block;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending { background: rgba(210,153,34,.15); color: var(--warning); }
.badge-transit { background: rgba(88,166,255,.15); color: var(--info); }
.badge-delivered { background: rgba(63,185,80,.15); color: var(--success); }
.badge-final { background: rgba(245,130,32,.15); color: var(--orange); }
.badge-active { background: rgba(63,185,80,.15); color: var(--success); }
.badge-inactive { background: rgba(248,81,73,.15); color: var(--danger); }

/* Alerts */
.alert {
    padding: .875rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: .9375rem;
    border: 1px solid transparent;
}

.alert-success { background: rgba(63,185,80,.1); border-color: rgba(63,185,80,.3); color: var(--success); }
.alert-danger { background: rgba(248,81,73,.1); border-color: rgba(248,81,73,.3); color: var(--danger); }
.alert-warning { background: rgba(210,153,34,.1); border-color: rgba(210,153,34,.3); color: var(--warning); }
.alert-info { background: rgba(88,166,255,.1); border-color: rgba(88,166,255,.3); color: var(--info); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1.125rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: .25rem;
}

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

.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: .625rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: .375rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg-card);
}

.timeline-item.completed::before { background: var(--success); }
.timeline-item.active::before { background: var(--orange); box-shadow: 0 0 0 4px rgba(245,130,32,.2); }
.timeline-item.final::before { background: var(--orange); }

.timeline-region { font-weight: 600; font-size: .9375rem; }
.timeline-meta { color: var(--text-muted); font-size: .8125rem; margin-top: .25rem; }

/* Shipment cards (mobile friendly) */
.shipment-cards { display: none; }

.shipment-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: .75rem;
}

.shipment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .75rem;
}

.shipment-card-plate { font-weight: 700; font-size: 1rem; color: var(--orange); }

.shipment-card-row {
    display: flex;
    justify-content: space-between;
    font-size: .8125rem;
    padding: .25rem 0;
    color: var(--text-muted);
}

.shipment-card-row span:last-child { color: var(--text); }

.shipment-card-actions { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.shipment-card-actions.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.shipment-card-actions .btn-block {
    width: 100%;
}

/* Document type chips */
.doc-chips { display: flex; flex-wrap: wrap; gap: .5rem; }

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .8125rem;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.doc-chip.selected {
    background: rgba(245,130,32,.15);
    border-color: var(--orange);
    color: var(--orange);
}

.doc-chip input { display: none; }

/* Evrak modal - adet seçimi */
.doc-modal-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.doc-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.doc-modal-item:has(.doc-select-cb:checked) {
    border-color: var(--orange);
    background: rgba(245,130,32,.06);
}

.doc-modal-check {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.doc-modal-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
    margin-bottom: .25rem;
}

.doc-modal-name {
    font-weight: 600;
    font-size: .9375rem;
}

.doc-modal-desc {
    color: var(--text-muted);
    font-size: .75rem;
}

.doc-qty-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}

.doc-qty-label {
    font-size: .6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.doc-qty-input {
    width: 72px;
    text-align: center;
    padding: .375rem .5rem;
}

.doc-qty-input:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .doc-modal-item {
        flex-direction: column;
        align-items: stretch;
    }
    .doc-qty-wrap {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .doc-qty-input { width: 100px; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }

/* Pagination */
.pagination {
    display: flex;
    gap: .375rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: .375rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: var(--text-muted);
}

.pagination a:hover { border-color: var(--orange); color: var(--orange); }
.pagination .active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* Detail view */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item label {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .25rem;
}

.detail-item span { font-weight: 500; }

.plate-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: .02em;
}

.ref-no { font-family: monospace; color: var(--blue-light); }

/* Login demo accounts */
.demo-accounts {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.demo-accounts h4 {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.demo-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    font-size: .8125rem;
    color: var(--text-muted);
}

.demo-account code {
    background: var(--bg-elevated);
    padding: .125rem .375rem;
    border-radius: 4px;
    color: var(--orange);
    font-size: .75rem;
}

/* Powered by footer */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 120, 200, 0.04) 100%);
    font-size: .8125rem;
    color: var(--text-muted);
    letter-spacing: .02em;
}

.app-footer span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.app-footer a {
    font-weight: 600;
    background: linear-gradient(135deg, var(--orange), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: opacity var(--transition);
}

.app-footer a:hover {
    opacity: .85;
}

.app-footer .footer-brand {
    font-weight: 700;
    background: linear-gradient(135deg, var(--orange), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-footer-auth {
    width: 100%;
    flex-direction: column;
    align-items: center;
    margin-top: 1.25rem;
    padding: 0;
    border-top: none;
    background: none;
    font-size: .75rem;
    opacity: .75;
}

.app-footer-auth:hover {
    opacity: 1;
}

.app-footer-auth a.footer-brand {
    cursor: pointer;
}

.app-footer-auth::before {
    content: '';
    display: block;
    width: 72px;
    height: 1px;
    margin: 0 auto 1rem;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main-wrapper { margin-left: 0; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .topbar {
        padding: .75rem 1rem;
        padding-top: max(.75rem, env(safe-area-inset-top));
        gap: .75rem;
    }

    .page-heading { font-size: 1.0625rem; }

    .table-desktop { display: none !important; }
    .shipment-cards { display: block; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.625rem; }

    .form-row { grid-template-columns: 1fr; }
    .filter-form .form-group:last-child .btn { flex: 1; min-width: calc(50% - .25rem); }

    .card { padding: 1rem; margin-bottom: 1rem; }
    .card-header { flex-direction: column; align-items: stretch; }
    .card-header .btn { width: 100%; }

    .auth-page {
        padding: 1rem;
        padding-top: max(1.5rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        align-items: stretch;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .auth-card { padding: 1.75rem 1.25rem; }
    .auth-logo { max-width: 260px; margin-bottom: 1.5rem; }

    .demo-account {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        padding: .625rem 0;
    }

    .demo-account .btn { width: 100%; justify-content: center; }

    .form-control,
    select.form-control,
    textarea.form-control {
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .modal-overlay {
        padding: .75rem;
        padding-bottom: max(.75rem, env(safe-area-inset-bottom));
        align-items: flex-end;
    }

    .modal {
        max-height: 92vh;
        max-height: 92dvh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .file-upload-area { padding: 1.5rem 1rem; }

    .detail-grid { grid-template-columns: 1fr; }

    .timeline { padding-left: 1.5rem; }

    .plate-display { font-size: 1.0625rem; word-break: break-word; }

    .shipment-card-actions.btn-group {
        flex-direction: column;
    }

    .shipment-card-actions.btn-group .btn,
    .shipment-card-actions.btn-group form {
        width: 100%;
    }

    .pagination a,
    .pagination span {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Stacked tables for admin CRUD & logs */
    .table-stack thead { display: none; }

    .table-stack tbody tr {
        display: block;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: .875rem 1rem;
        margin-bottom: .75rem;
    }

    .table-stack tbody tr:hover { background: var(--bg-elevated); }

    .table-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        padding: .4rem 0;
        border-bottom: none;
        text-align: right;
    }

    .table-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: .6875rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .04em;
        text-align: left;
        flex-shrink: 0;
        max-width: 42%;
    }

    .table-stack tbody td.table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        padding-top: .75rem;
        margin-top: .375rem;
        border-top: 1px solid var(--border);
    }

    .table-stack tbody td.table-actions::before { display: none; }

    .table-stack tbody td.table-actions .btn,
    .table-stack tbody td.table-actions form {
        width: 100%;
    }

    .table-stack tbody td.table-actions form .btn {
        width: 100%;
    }

    .table-stack tbody td[data-label="Tarih"] {
        white-space: normal;
    }

    .table-stack tbody td[data-label="Detay"] {
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
    }

    .table-stack tbody td[data-label="Detay"] small {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-date { display: none; }
    .stat-card { padding: 1rem; }
    .auth-card { padding: 1.5rem 1rem; }
    .empty-state { padding: 2rem 1rem; }
    .file-preview-item { width: calc(50% - .375rem); height: auto; aspect-ratio: 1; }
}

/* Print */
@media print {
    .sidebar, .topbar, .btn, .table-actions, .app-footer { display: none !important; }
    .main-wrapper { margin-left: 0; }
    body { background: #fff; color: #000; }
}
