* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Segoe UI, Arial, sans-serif;
    background-color: #f2f4f7;
    color: #1f2937;
}

/* ---------- Login sayfası ---------- */
.login-body {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    min-height: 100vh;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    padding: 32px 36px;
    width: 100%;
    max-width: 380px;
    position: relative;
}

.login-lang {
    position: absolute;
    top: 16px;
    right: 16px;
}

.lang-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    margin: 0;
    color: #1e3a5f;
    font-size: 28px;
    letter-spacing: 1px;
}

.login-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
}

.login-field {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.login-actions {
    margin-top: 20px;
}

.btn-login {
    width: 100%;
    padding: 11px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-login:hover {
    background-color: #1d4ed8;
}

.error-text {
    display: block;
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
}

.demo-info {
    margin-top: 20px;
    padding: 10px 12px;
    background-color: #f1f5f9;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    text-align: center;
}

.demo-info strong {
    display: block;
    margin-bottom: 4px;
    color: #334155;
}

/* ---------- Menü sayfası ---------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e3a5f;
    color: #ffffff;
    padding: 14px 28px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 1px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.hamburger-btn:hover {
    background-color: rgba(255,255,255,0.15);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-label {
    font-size: 14px;
}

.logout-link {
    background-color: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.logout-link:hover {
    background-color: rgba(255,255,255,0.15);
}

.app-layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: #1e3a5f;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.2s ease, padding 0.2s ease;
    padding-top: 10px;
}

.sidebar.collapsed {
    width: 0;
    padding-top: 10px;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 22px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-item:hover {
    background-color: rgba(255,255,255,0.12);
    color: #ffffff;
}

.sidebar-item.active {
    background-color: rgba(255,255,255,0.16);
    color: #ffffff;
    border-left: 3px solid #60a5fa;
}

.sidebar-item .menu-icon {
    font-size: 20px;
    line-height: 1;
}

.sidebar-text {
    white-space: nowrap;
}

.main-content {
    flex: 1;
    padding: 32px 36px;
}

.main-content h1 {
    font-size: 22px;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.main-hint {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.dashboard-card {
    display: block;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.dashboard-card-header .menu-icon {
    font-size: 20px;
}

.dashboard-card-stat {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.dashboard-note {
    margin-top: 22px;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.chart-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px 28px;
    max-width: 760px;
}

.chart-card h3 {
    margin: 0 0 18px;
    font-size: 15px;
    color: #1e3a5f;
}

.chart-section {
    margin-top: 26px;
}

.chart-section-title {
    font-size: 17px;
    color: #1e3a5f;
    margin: 0 0 4px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.chart-grid .chart-card {
    max-width: none;
}

.assign-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.assign-form .input-field {
    width: auto;
    min-width: 220px;
}

.remove-link {
    color: #dc2626;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}

.remove-link:hover {
    text-decoration: underline;
}

.progress-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.progress-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-form-row label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
}

.progress-form-row .input-field {
    width: auto;
    min-width: 150px;
}

.form-error {
    display: block;
    margin-top: 10px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
}

.daily-photo-thumb {
    width: 72px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.data-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px 28px;
    margin-top: 20px;
    overflow-x: auto;
}

.data-card h3 {
    margin: 0 0 14px;
    font-size: 15px;
    color: #1e3a5f;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    white-space: nowrap;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
}

.badge-green { background-color: #16a34a; }
.badge-yellow { background-color: #eab308; }
.badge-red { background-color: #dc2626; }
.badge-blue { background-color: #3b82f6; }
.badge-gray { background-color: #94a3b8; }
.badge-orange { background-color: #ea580c; }

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-link {
    display: inline-block;
    color: #ffffff;
    background-color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(37,99,235,0.35);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.detail-link:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

.detail-link:active {
    transform: scale(0.97);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.info-item {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 700;
}

.info-value {
    font-size: 15px;
    color: #1e3a5f;
    font-weight: 700;
}

.map-frame {
    width: 100%;
    height: 260px;
    border: 0;
    border-radius: 8px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.photo-tile {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.photo-placeholder {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: #ffffff;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
}

.photo-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background-color: #e2e8f0;
}

.photo-caption {
    padding: 10px 12px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.photo-caption strong {
    color: #1e3a5f;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Zaman cizelgesi (siparis takibi, onay akisi vb. icin) */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 4px 0 20px;
    position: relative;
}

.timeline-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 18px;
    bottom: -4px;
    width: 2px;
    background-color: #e2e8f0;
}

.timeline-marker {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    background-color: #cbd5e1;
    margin-top: 3px;
    z-index: 1;
}

.timeline-step.done .timeline-marker {
    background-color: #16a34a;
}

.timeline-step.current .timeline-marker {
    background-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.timeline-content strong {
    display: block;
    color: #1e3a5f;
    font-size: 14px;
}

.timeline-content span {
    font-size: 12px;
    color: #64748b;
}

.summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.summary-chip {
    background-color: #eef2f7;
    color: #1e3a5f;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
}

.filter-btn {
    margin-top: 14px;
    padding: 10px 20px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.filter-btn:hover {
    background-color: #1d4ed8;
}

.doc-icon {
    font-size: 22px;
}

.doc-name {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    flex: 1;
}

.doc-row-link {
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.doc-row-link:hover {
    background-color: #eef2f7;
    border-color: #2563eb;
}

.doc-view {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
}

.doc-preview {
    position: relative;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #f8fafc;
    overflow: hidden;
}

.doc-watermark {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-28deg);
    font-size: 42px;
    font-weight: 800;
    color: rgba(37, 99, 235, 0.08);
    letter-spacing: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

.permit-paper {
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 22px 24px;
    max-width: 620px;
    margin: 0 auto;
}

.permit-header {
    text-align: center;
    font-size: 14px;
    color: #1e3a5f;
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.permit-title {
    text-align: center;
    color: #0f172a;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.permit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.permit-table td {
    padding: 8px 10px;
    border-bottom: 1px dashed #e2e8f0;
    vertical-align: top;
}

.permit-label {
    font-weight: 700;
    color: #475569;
    width: 40%;
}

.permit-stamp {
    margin-top: 18px;
    display: inline-block;
    padding: 8px 16px;
    border: 3px solid #16a34a;
    color: #16a34a;
    font-weight: 800;
    border-radius: 8px;
    transform: rotate(-4deg);
}

.sketch-wrap {
    position: relative;
    z-index: 1;
    text-align: center;
}

.sketch-svg {
    width: 100%;
    max-width: 480px;
    height: auto;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.stat-bar-track {
    background-color: #e2e8f0;
    border-radius: 999px;
    height: 28px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.stat-bar-fill {
    background-color: #16a34a;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* =========================================================
   MOBIL UYUMLULUK (ekran genisligi <= 768px)
   ========================================================= */
@media (max-width: 768px) {

    /* Login ekrani */
    .login-box {
        padding: 26px 22px;
        max-width: 100%;
    }

    .login-lang {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin-bottom: 12px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    /* Ust bar */
    .topbar {
        padding: 12px 14px;
    }

    .topbar h2 {
        font-size: 17px;
    }

    .user-label {
        display: none;
    }

    .logout-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Sidebar: masaustunde daralarak kapanir, mobilde soldan
       kayan bir panel (overlay) olarak acilir/kapanir. */
    .app-layout {
        position: relative;
        min-height: calc(100vh - 49px);
    }

    .sidebar {
        position: fixed;
        top: 49px;
        left: 0;
        height: calc(100vh - 49px);
        width: 230px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
        padding-top: 10px;
        box-shadow: none;
    }

    .sidebar.collapsed {
        width: 230px;
        transform: translateX(0);
        box-shadow: 6px 0 20px rgba(0,0,0,0.35);
    }

    .main-content {
        padding: 18px 16px;
        width: 100%;
    }

    .main-content h1 {
        font-size: 19px;
    }

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

    .chart-card,
    .data-card {
        padding: 16px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .assign-form,
    .progress-form {
        flex-direction: column;
        align-items: stretch;
    }

    .assign-form .input-field,
    .progress-form-row .input-field {
        min-width: 0;
        width: 100%;
    }

    .data-table {
        font-size: 12px;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

    .map-frame {
        height: 200px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    /* Liste tablolari mobilde yatay kaydirma yerine "kart" olarak gosterilir:
       her <tr> tek basina bir kart olur, her <td> icin gizli basligi
       (attr(data-label)) sol tarafta etiket olarak belirir. */
    .data-card {
        overflow-x: visible;
    }

    .data-table {
        white-space: normal;
    }

    .data-table thead {
        position: absolute;
        left: -9999px;
        top: -9999px;
    }

    .data-table,
    .data-table tbody,
    .data-table tr {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 4px 0;
        background-color: #ffffff;
    }

    .data-table tr:last-child {
        margin-bottom: 0;
    }

    .data-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        text-align: right;
        white-space: normal;
        word-break: break-word;
        border-bottom: 1px solid #f1f5f9;
        padding: 9px 12px;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        color: #64748b;
    }

    .photo-img {
        height: 120px;
    }

    .doc-row {
        flex-wrap: wrap;
    }

    .permit-paper {
        padding: 16px 14px;
    }

    .permit-table {
        font-size: 12px;
    }

    .doc-watermark {
        font-size: 28px;
    }
}

@media (max-width: 400px) {
    .login-wrapper {
        padding: 10px;
    }

    .login-box {
        padding: 20px 16px;
    }

    .demo-info {
        font-size: 11px;
    }

    .info-grid,
    .photo-grid {
        grid-template-columns: 1fr;
    }
}
