:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --text: #111827;
    --muted: #667085;
    --line: #e7edf5;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --purple: #7c3aed;
    --shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 272px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.logo span,
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f172a);
    font-weight: 800;
}

.logo strong {
    font-size: 20px;
    letter-spacing: 0;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 13px;
    border-radius: var(--radius);
    color: #42526b;
    transition: 180ms ease;
}

.sidebar nav a:hover,
.sidebar nav a.is-active {
    color: var(--blue);
    background: var(--blue-soft);
}

.sidebar nav a.is-disabled {
    opacity: 0.48;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: inherit;
}

.sidebar-footer {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface-soft);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12);
}

.main-panel {
    min-width: 0;
    padding: 30px clamp(18px, 4vw, 48px) 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1,
h2,
p {
    margin-top: 0;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(28px, 3.2vw, 42px);
    letter-spacing: 0;
}

.topbar-actions,
.toolbar-actions,
.record-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.icon-button,
.avatar,
.button {
    border: 0;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.icon-button,
.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: #344054;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.avatar {
    color: #fff;
    background: #111827;
    font-weight: 800;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-weight: 750;
    white-space: nowrap;
}

.button.primary {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.button.ghost {
    color: #344054;
    background: #fff;
    border: 1px solid var(--line);
}

.button.danger {
    color: var(--red);
    background: #fff1f2;
}

.button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(17, 24, 39, 0.12);
}

.page-transition {
    animation: pageIn 260ms ease both;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card,
.panel,
.record-card,
.install-card,
.install-hero,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.metric-card {
    position: relative;
    padding: 22px;
    overflow: hidden;
}

.metric-card p {
    margin-bottom: 18px;
    color: var(--muted);
    font-weight: 650;
}

.metric-card strong {
    display: block;
    font-size: 30px;
    letter-spacing: 0;
}

.metric-card small {
    color: var(--muted);
}

.metric-dot {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--blue);
}

.metric-dot.green { background: var(--green); }
.metric-dot.amber { background: var(--amber); }
.metric-dot.red { background: var(--red); }
.metric-dot.purple { background: var(--purple); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.panel {
    padding: 24px;
}

.panel-header,
.record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel h2,
.record-card h2,
.modal-card h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0;
}

.map-panel {
    grid-row: span 2;
}

.map-surface {
    position: relative;
    min-height: 410px;
    overflow: hidden;
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
        #f8fbff;
    background-size: 44px 44px;
}

.map-pin {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.12);
}

.pin-a { top: 24%; left: 20%; }
.pin-b { top: 50%; left: 55%; }
.pin-c { top: 68%; left: 76%; }

.route-line {
    position: absolute;
    inset: 28% 18% 26% 23%;
    border-top: 2px dashed rgba(37, 99, 235, 0.35);
    border-right: 2px dashed rgba(37, 99, 235, 0.35);
    transform: skew(-12deg);
}

.map-copy {
    position: absolute;
    left: 24px;
    bottom: 24px;
    display: grid;
    gap: 4px;
    padding: 16px;
    max-width: 280px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.1);
}

.map-copy span,
.activity-row small,
.record-card p,
.record-meta,
.empty-inline {
    color: var(--muted);
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.activity-icon {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--amber);
}

.activity-icon.done {
    background: var(--green);
}

.pill,
.status,
.label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #344054;
    background: #eef4ff;
    font-size: 13px;
    font-weight: 750;
}

.status.active,
.label.yesil {
    color: #067647;
    background: #dcfae6;
}

.status.pending,
.label.sari {
    color: #b54708;
    background: #fef0c7;
}

.status.expired,
.label.kirmizi {
    color: #b42318;
    background: #fee4e2;
}

.label.mavi {
    color: #175cd3;
    background: #d1e9ff;
}

.status.bekliyor,
.status.pending {
    color: #344054;
    background: #f2f4f7;
}

.status.planlandi,
.status.personel_atandi,
.status.in_progress {
    color: #175cd3;
    background: #d1e9ff;
}

.status.yolda,
.status.bakim_yapiliyor,
.status.urgent,
.status.critical {
    color: #b54708;
    background: #fef0c7;
}

.status.tamamlandi,
.status.completed {
    color: #067647;
    background: #dcfae6;
}

.status.iptal,
.status.cancelled {
    color: #b42318;
    background: #fee4e2;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.toolbar-search {
    display: flex;
    gap: 10px;
    flex: 1;
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border 180ms ease, box-shadow 180ms ease;
}

input,
select {
    height: 46px;
    padding: 0 14px;
}

textarea {
    min-height: 92px;
    padding: 12px 14px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card-grid.is-list {
    grid-template-columns: 1fr;
}

.record-card {
    padding: 20px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 56px rgba(17, 24, 39, 0.12);
}

.record-card p {
    min-height: 46px;
    line-height: 1.5;
}

.record-meta {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.record-actions {
    justify-content: flex-end;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
    z-index: 40;
}

.modal.is-open {
    display: flex;
}

.modal-card {
    position: relative;
    width: min(680px, 100%);
    max-height: 92vh;
    overflow: auto;
    padding: 26px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
    animation: modalIn 200ms ease both;
}

.modal-card.wide {
    width: min(960px, 100%);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface-soft);
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: #344054;
    font-weight: 700;
}

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

.empty-state {
    grid-column: 1 / -1;
    padding: 38px;
    text-align: center;
}

.mobile-work-header,
.tech-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.mobile-work-header h2,
.tech-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 36px);
}

.mobile-work-header p,
.tech-hero p {
    margin-bottom: 0;
    color: var(--muted);
}

.work-form {
    display: grid;
    gap: 18px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.check-card,
.tech-job {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
}

.check-card h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: #344054;
    font-weight: 750;
}

.segmented input {
    width: auto;
    height: auto;
}

.form-section {
    margin-bottom: 24px;
}

.tech-job {
    display: grid;
    gap: 8px;
}

.tech-job small {
    color: var(--muted);
    line-height: 1.5;
}

.quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.route-map {
    min-height: 520px;
}

.route-chip {
    position: absolute;
    left: var(--x);
    top: var(--y);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #fff;
    background: var(--blue);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.13);
    font-weight: 900;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-grid span {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: var(--radius);
    color: var(--muted);
    background: var(--surface-soft);
}

.detail-grid strong {
    color: var(--text);
}

.bar-chart {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 130px;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.bar-row div {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-soft);
}

.bar-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #16a34a);
}

.bar-row strong {
    color: var(--text);
    text-align: right;
}

.table-panel {
    margin-top: 18px;
}

.data-table {
    display: grid;
    gap: 8px;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 120px 1.1fr 1.4fr 120px 140px;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-radius: var(--radius);
}

.table-head {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-row {
    background: #fff;
    border: 1px solid var(--line);
}

.table-row strong {
    text-align: right;
}

.alert-band {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius);
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.pdf-document {
    width: min(980px, 100%);
    margin: 0 auto 24px;
    padding: 44px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.pdf-header,
.pdf-footer,
.pdf-grid {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.pdf-header {
    align-items: flex-start;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.pdf-header > div {
    display: grid;
    gap: 6px;
}

.pdf-logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    color: #fff;
    background: #111827;
    font-weight: 900;
}

.pdf-title {
    padding: 28px 0;
}

.pdf-title h1 {
    margin-bottom: 8px;
    font-size: 38px;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.pdf-grid div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.pdf-grid span,
.pdf-note p,
.pdf-footer {
    color: var(--muted);
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.pdf-table th,
.pdf-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.pdf-table th:last-child,
.pdf-table td:last-child {
    text-align: right;
}

.pdf-table tfoot th {
    font-size: 22px;
}

.pdf-note {
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.pdf-footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.pdf-actions {
    display: flex;
    justify-content: center;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.mini-chart {
    display: grid;
    gap: 12px;
}

.empty-state p {
    color: var(--muted);
}

.install-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.12), transparent 28%),
        var(--bg);
}

.install-shell {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 24px;
    width: min(1160px, calc(100% - 36px));
    min-height: 100vh;
    margin: 0 auto;
    align-items: center;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    width: min(100% - 32px, 460px);
    margin: 0 auto;
}

.login-card {
    width: 100%;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 16px 0 8px;
    font-size: 38px;
}

.muted {
    color: var(--muted);
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.install-hero,
.install-card {
    padding: clamp(26px, 4vw, 44px);
}

.install-hero h1 {
    max-width: 560px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: 0;
}

.install-hero p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.install-points {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.install-points span {
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
}

.alert {
    padding: 12px;
    border-radius: var(--radius);
    color: #b42318;
    background: #fee4e2;
}

.success-state {
    display: grid;
    justify-items: start;
    gap: 12px;
}

.icon-bubble {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    color: #fff;
    background: var(--green);
    font-weight: 900;
}

@media print {
    .sidebar,
    .topbar-actions,
    .toolbar {
        display: none;
    }
    .app-shell {
        display: block;
    }
    .main-panel {
        padding: 0;
    }
}

@media (max-width: 1180px) {
    .metric-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app-shell,
    .install-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .sidebar-footer {
        position: static;
        margin-top: 18px;
    }
    .sidebar nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .topbar,
    .toolbar,
    .toolbar-search,
    .mobile-work-header,
    .tech-hero {
        align-items: stretch;
        flex-direction: column;
    }
    .metric-grid,
    .card-grid,
    .report-grid,
    .form-grid,
    .check-grid,
    .pdf-grid {
        grid-template-columns: 1fr;
    }
    .bar-row,
    .table-head,
    .table-row {
        grid-template-columns: 1fr;
    }
    .table-row strong,
    .bar-row strong {
        text-align: left;
    }
    .span-2 {
        grid-column: span 1;
    }
    .install-shell {
        padding: 22px 0;
    }
}

@media print {
    .pdf-actions,
    .sidebar,
    .topbar,
    .toolbar {
        display: none !important;
    }
    body {
        background: #fff;
    }
    .app-shell {
        display: block;
    }
    .main-panel {
        padding: 0;
    }
    .pdf-document {
        width: 100%;
        box-shadow: none;
        padding: 0;
    }
}

@media (max-width: 560px) {
    .main-panel {
        padding: 20px 14px 34px;
    }
    .sidebar nav {
        grid-template-columns: 1fr 1fr;
    }
    .topbar-actions,
    .toolbar-actions,
    .record-actions {
        width: 100%;
    }
    .button,
    .record-actions form,
    .inline-form {
        width: 100%;
    }
    .map-surface {
        min-height: 300px;
    }
}
