* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: #f4f6f9;
    color: #1f2937;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

body.mobile-menu-lock {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

img {
    max-width: 100%;
    display: block;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    background: #f4f6f9;
}

.left-panel {
    width: 65%;
    background: #1e3a5f;
    color: #ffffff;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.left-panel:before,
.left-panel:after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.left-panel:before {
    width: 430px;
    height: 430px;
    right: -160px;
    top: -120px;
}

.left-panel:after {
    width: 360px;
    height: 360px;
    left: -130px;
    bottom: -130px;
}

.left-panel h1 {
    position: relative;
    z-index: 2;
    max-width: 760px;
    font-size: 46px;
    line-height: 1.15;
    margin-bottom: 18px;
}

.left-panel h1:after {
    content: "Araç bakım, arıza, muayene, sigorta ve yakıt süreçleri için merkezi takip paneli.";
    display: block;
    max-width: 680px;
    margin-top: 18px;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    opacity: 0.88;
}

.left-panel p {
    position: relative;
    z-index: 2;
    display: inline-block;
    min-width: 255px;
    margin-top: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.13);
    font-size: 15px;
    font-weight: 600;
}

.left-panel p:first-of-type {
    margin-top: 26px;
}

.right-panel {
    width: 35%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 46px;
}

.login-box {
    width: 100%;
    max-width: 410px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 36px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.11);
}

.login-box:before {
    content: "CF";
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e3a5f;
    color: #ffffff;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 24px;
}

.login-box h2 {
    color: #1e3a5f;
    font-size: 32px;
    margin-bottom: 8px;
}

.login-box h2:after {
    content: "Yetkili kullanıcı girişi yapın. Yeni cihaz girişleri yönetici onayına tabidir.";
    display: block;
    margin-top: 10px;
    margin-bottom: 26px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control,
.mobile-user-form input,
.mobile-user-form select,
.inline-user-form input,
.inline-user-form select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    outline: none;
}

.form-group textarea,
textarea.form-control {
    min-height: 110px;
    padding-top: 12px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus,
.mobile-user-form input:focus,
.mobile-user-form select:focus,
.inline-user-form input:focus,
.inline-user-form select:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.12);
}

.login-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: #1e3a5f;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.login-btn {
    width: 100%;
    height: 50px;
    margin-top: 6px;
}

.login-btn:hover,
.btn:hover {
    background: #274d7d;
}

.btn.secondary,
.btn-light {
    background: #f1f5f9;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn.secondary:hover,
.btn-light:hover {
    background: #e2e8f0;
}

.btn.danger {
    background: #dc2626;
    color: #ffffff;
}

.btn.danger:hover {
    background: #b91c1c;
}

.btn.small {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 13px;
}

.login-box form:after {
    content: "Cihaz onayı, hatalı giriş kilidi ve işlem kayıtları aktiftir.";
    display: block;
    margin-top: 18px;
    padding: 13px 14px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.version {
    margin-top: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.login-message,
.alert {
    margin-bottom: 16px;
    padding: 13px 14px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.45;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.login-message.error,
.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-message.warning,
.alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.login-message.success,
.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* App Layout */
.app-shell {
    min-height: 100vh;
    display: flex;
    background: #f4f6f9;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #172b46;
    color: #ffffff;
    padding: 18px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 10px 10px 18px;
    font-size: 18px;
    font-weight: 800;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 10px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

.sidebar-overlay {
    display: none;
}

.main-area {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-heading {
    min-width: 0;
}

.topbar-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.topbar-subtitle {
    margin-top: 2px;
    color: #64748b;
    font-size: 14px;
}

.topbar-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: #64748b;
    font-size: 14px;
}

.topbar-account-name {
    color: #334155;
    font-weight: 700;
}

.topbar-account-role {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 800;
}

.mobile-menu-button {
    display: none;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    font-weight: 800;
}

.content {
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title {
    color: #0f172a;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}

.page-subtitle {
    margin-top: 6px;
    color: #64748b;
    font-size: 14px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.panel-body {
    padding: 18px;
}

.stat-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -7px -7px 13px;
}

.stat-card {
    width: calc(25% - 14px);
    margin: 7px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

a.stat-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.stat-card:hover {
    border-color: #9fb3c8;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.11);
    transform: translateY(-1px);
}

.stat-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    margin-top: 8px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}

.form-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -8px;
}

.form-grid .form-group {
    width: calc(50% - 16px);
    margin: 8px;
}

.form-grid .full {
    width: calc(100% - 16px);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.data-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
}

.data-table td {
    color: #1f2937;
}

.data-table tr:hover td {
    background: #fafafa;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.mobile-card-list {
    display: none;
}

.mobile-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.mobile-card-title {
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 8px;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-top: 1px solid #eef2f7;
    color: #64748b;
    font-size: 13px;
}

.mobile-card-row strong {
    color: #1f2937;
    text-align: right;
    word-break: break-word;
}

.inline-user-form {
    margin: 8px 0 0;
}

.inline-user-form input[type="password"] {
    width: 180px;
}

.mobile-user-form {
    margin-top: 12px;
}

.mobile-user-form label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 4px;
}

/* QR */
.qr-print-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.qr-card {
    width: 420px;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #d8e0ea;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.qr-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.qr-plate {
    display: inline-block;
    margin: 8px 0 6px;
    padding: 10px 18px;
    border: 2px solid #111827;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #111827;
    background: #f9fafb;
}

.qr-meta {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 18px;
}

.qr-image {
    display: block;
    width: 280px;
    height: 280px;
    max-width: 100%;
    margin: 0 auto;
}

.qr-note {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}

/* Tablet */
@media (max-width: 1100px) {
    .left-panel {
        width: 55%;
        padding: 50px;
    }

    .right-panel {
        width: 45%;
    }

    .left-panel h1 {
        font-size: 38px;
    }

    .stat-card {
        width: calc(50% - 14px);
    }
}

/* Mobile */
@media (max-width: 850px) {
    body {
        background: #f3f6fb;
    }

    .login-container {
        display: block;
        min-height: 100vh;
        background: #f4f6f9;
    }

    .left-panel {
        width: 100%;
        padding: 34px 24px 28px;
        min-height: auto;
        border-radius: 0 0 24px 24px;
    }

    .left-panel h1 {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .left-panel h1:after {
        font-size: 14px;
        margin-top: 10px;
        line-height: 1.5;
    }

    .left-panel p {
        display: inline-block;
        min-width: auto;
        width: auto;
        margin: 7px 6px 0 0;
        padding: 10px 12px;
        border-radius: 13px;
        font-size: 13px;
    }

    .left-panel p:first-of-type {
        margin-top: 14px;
    }

    .right-panel {
        width: 100%;
        padding: 24px;
        align-items: flex-start;
    }

    .login-box {
        max-width: none;
        padding: 26px;
        border-radius: 20px;
        margin-top: 0;
    }

    .login-box:before {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        margin-bottom: 18px;
    }

    .login-box h2 {
        font-size: 27px;
    }

    .form-group input,
    .form-group select,
    .form-control {
        min-height: 50px;
    }

    .login-btn {
        height: 52px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 60;
        top: 0;
        left: 0;
        width: 285px;
        max-width: 84vw;
        height: 100vh;
        min-height: 100vh;
        padding: 22px 18px;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 18px 0 35px rgba(15, 23, 42, 0.22);
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        z-index: 55;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .app-shell.sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .sidebar-brand {
        padding: 8px 6px 18px;
        font-size: 20px;
    }

    .sidebar-nav {
        white-space: normal;
        overflow-x: visible;
    }

    .sidebar-nav a {
        display: flex;
        white-space: normal;
        min-height: 42px;
        margin-right: 0;
        margin-bottom: 7px;
        padding: 10px 12px;
        font-size: 15px;
    }

    .mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        grid-column: 1;
        width: 42px;
        min-width: 42px;
        height: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 14px;
        background: #ffffff;
        border: 1px solid #d8e0ea;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
        font-size: 0;
        position: relative;
    }

    .mobile-menu-button:before {
        content: "";
        width: 18px;
        height: 2px;
        background: #1f2937;
        border-radius: 999px;
        box-shadow: 0 -6px 0 #1f2937, 0 6px 0 #1f2937;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        min-height: 58px;
        padding: 8px 12px;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    }

    .topbar-heading {
        grid-column: 2;
        min-width: 0;
        text-align: center;
    }

    .topbar-title {
        font-size: 17px;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-subtitle {
        display: none;
    }

    .topbar-account {
        grid-column: 3;
        max-width: 118px;
        min-width: 0;
        justify-content: flex-end;
        gap: 5px;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
    }

    .topbar-account-name {
        max-width: 76px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-account-role {
        min-height: 22px;
        padding: 2px 7px;
        font-size: 11px;
    }

    .content {
        padding: 14px;
    }

    .page-header {
        display: block;
        margin-bottom: 14px;
    }

    .page-actions {
        justify-content: stretch;
        margin-top: 12px;
        gap: 8px;
    }

    .page-header .btn,
    .page-actions .btn {
        width: 100%;
    }

    .page-title {
        font-size: 22px;
    }

    .page-subtitle {
        font-size: 13px;
        line-height: 1.45;
    }

    .panel {
        border-radius: 10px;
    }

    .panel-header {
        display: block;
        padding: 14px;
    }

    .panel-header .btn,
    .panel-header .badge {
        margin-top: 10px;
    }

    .panel-body {
        padding: 14px;
    }

    .form-grid {
        display: block;
        margin: 0;
    }

    .form-grid .form-group,
    .form-grid .full {
        width: 100%;
        margin: 0 0 16px;
    }

    .desktop-table {
        display: none;
    }

    .mobile-card-list {
        display: block;
    }

    .mobile-card {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .stat-grid {
        margin: -6px -6px 12px;
    }

    .stat-card {
        width: calc(50% - 12px);
        margin: 6px;
        padding: 14px;
        border-radius: 10px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 26px;
    }
}

/* Small Mobile */
@media (max-width: 420px) {
    .left-panel {
        padding: 28px 20px 24px;
    }

    .right-panel {
        padding: 20px;
    }

    .login-box {
        padding: 24px 20px;
    }

    .left-panel p {
        font-size: 12.5px;
    }

    .topbar {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .topbar-account {
        max-width: 106px;
    }

    .topbar-account-name {
        max-width: 66px;
    }

    .stat-card {
        width: calc(100% - 12px);
        padding: 14px;
    }

    .stat-value {
        font-size: 26px;
    }

    .qr-card {
        padding: 18px;
    }

    .qr-image {
        width: 240px;
        height: 240px;
    }

    .qr-plate {
        font-size: 23px;
    }
}

/* Print */
@media print {
    body {
        background: #ffffff !important;
        color: #000000;
    }

    .no-print,
    .sidebar,
    .sidebar-overlay,
    .topbar,
    .mobile-menu-button,
    .page-actions,
    header,
    aside,
    nav,
    button,
    .btn {
        display: none !important;
    }

    .app-shell,
    .main-area,
    .content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
    }

    .panel,
    .stat-card,
    .mobile-card,
    .qr-card {
        box-shadow: none !important;
        border-color: #111827 !important;
        page-break-inside: avoid;
    }

    .qr-print-area {
        padding: 0;
        min-height: 100vh;
        align-items: center;
    }
}