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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #000;
    color: #2d3748;
    min-height: 100vh;
    padding: 20px;
    padding-top: 80px;
    position: relative;
}

/* ───── Navigation Bar ───── */
.panel-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid #1a1a1a;
    gap: 4px;
    overflow-x: auto;
}

.panel-nav .nav-brand {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px 0 0;
    margin-right: 8px;
    border-right: 1px solid #1a1a1a;
}

.panel-nav .nav-brand img {
    height: 24px;
    width: auto;
    display: block;
}

.panel-nav .nav-link {
    color: #a0aec0;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.panel-nav .nav-link:hover {
    color: #fff;
    background: rgba(70, 126, 232, 0.15);
}

.panel-nav .nav-link.active {
    color: #fff;
    background: #467ee8;
}

.panel-nav .nav-spacer {
    flex: 1;
}

.panel-nav .nav-logout {
    background: #FF5271;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
}

.panel-nav .nav-logout:hover {
    background: #e63d5e;
}

.logo {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 72px;
    height: auto;
    z-index: 99999 !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h1 {
    color: #1a202c;
    margin-bottom: 8px;
    font-size: 28px;
}

h2 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.subtitle {
    color: #718096;
    margin-bottom: 32px;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #718096;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.tab:hover {
    color: #467ee8;
    background: rgba(70, 126, 232, 0.05);
}

.tab.active {
    color: #467ee8;
    border-bottom-color: #467ee8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

input,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #467ee8;
    box-shadow: 0 0 0 3px rgba(70, 126, 232, 0.1);
}

input:disabled {
    background: #f7fafc;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.help-text {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

button {
    background: #467ee8;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 12px;
}

button:hover:not(:disabled) {
    background: #3568d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(70, 126, 232, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #1EC298;
}

.btn-secondary:hover:not(:disabled) {
    background: #17a07d;
}

.btn-danger {
    background: #FF5271;
}

.btn-danger:hover:not(:disabled) {
    background: #e63d5e;
}

.btn-control {
    background: #467EE8;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-control:hover:not(:disabled) {
    background: #3568d0;
}

.alert {
    padding: 16px;
    padding-right: 40px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    position: relative;
}

.alert-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: #d4f5e9;
    color: #0e5c44;
    border: 1px solid #8fe0c4;
}

.alert-error {
    background: #ffe0e6;
    color: #8a1f38;
    border: 1px solid #ff8fa0;
}

.login-form {
    max-width: 400px;
    margin: 100px auto;
}

.logout-btn {
    background: #FF5271;
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.logout-btn:hover {
    background: #e63d5e;
}

.response-box {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.response-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 12px;
    color: #2d3748;
}

.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-box {
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
    margin: 0 0 12px 0;
    color: #2d3748;
}

.modal-box p {
    color: #4a5568;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-neutral {
    background: #a0aec0;
}

.btn-neutral:hover:not(:disabled) {
    background: #718096;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.iframe-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.iframe-wrapper {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 600px;
    border: none;
}

.iframe-title {
    background: #f7fafc;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 12px;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table-wrap .data-table {
    min-width: 900px;
}

.data-table.table-fixed {
    table-layout: fixed;
    /* th genişliklerinin toplamı; altında kolonlar orantılı daralmak yerine kaydırılır */
    min-width: 1332px;
}

/* Uzun metin sarınca satırlar uzuyor; hücreler üstten hizalansın */
.data-table.table-fixed td {
    vertical-align: top;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    overflow-wrap: anywhere;
}

/* Tek satırda kalması istenen kısa alanlar */
.cell-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f7fafc;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    font-size: 14px;
}

.info-box {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.info-box h3 {
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 8px;
}

.info-box p {
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 4px;
}

.editable-section {
    background: #f3ecfc;
    border: 2px solid #BB8EEC;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.editable-section h3 {
    color: #6d3faf;
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.panel {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.panel h3 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 16px;
}

.panel-existing {
    border-color: #467EE8;
}

.panel-existing h3 {
    color: #1f4a8a;
}

.panel-request {
    border-color: #FF5271;
}

.panel-request h3 {
    color: #e63d5e;
}

.data-display {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.data-display pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

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

.category-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px;
    background: white;
    font-size: 12px;
}

.category-item {
    padding: 4px 8px;
    border-bottom: 1px solid #edf2f7;
}

.category-item:last-child {
    border-bottom: none;
}

/* ───── Lukal Info Dashboard ───── */
.lukal-info-btn {
    background: #BB8EEC;
    color: #fff !important;
    font-weight: 700;
    padding: 8px 16px;
    margin-left: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(187, 142, 236, 0.6);
    transition: all 0.3s ease;
}

.lukal-info-btn:hover:not(:disabled) {
    background: #a06fd9;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(187, 142, 236, 0.8);
}

.stats-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stats-row-primary {
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 24px;
}

.stats-row-secondary {
    grid-template-columns: repeat(2, 1fr);
}

.stats-row-primary .stat-value {
    font-size: 34px;
}

@media (max-width: 1100px) {
    .stats-row-primary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, #467EE8 0%, #3568d0 100%);
    border-radius: 16px;
    padding: 28px 24px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(70, 126, 232, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(70, 126, 232, 0.45);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #1EC298 0%, #17a07d 100%);
    box-shadow: 0 8px 32px rgba(30, 194, 152, 0.3);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 12px 40px rgba(30, 194, 152, 0.45);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #BB8EEC 0%, #9a6fcf 100%);
    box-shadow: 0 8px 32px rgba(187, 142, 236, 0.3);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 12px 40px rgba(187, 142, 236, 0.45);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #F6A623 0%, #d98c12 100%);
    box-shadow: 0 8px 32px rgba(246, 166, 35, 0.3);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 12px 40px rgba(246, 166, 35, 0.45);
}

.stat-card:nth-child(5) {
    background: linear-gradient(135deg, #FF5271 0%, #e23b59 100%);
    box-shadow: 0 8px 32px rgba(255, 82, 113, 0.3);
}

.stat-card:nth-child(5):hover {
    box-shadow: 0 12px 40px rgba(255, 82, 113, 0.45);
}

/* Secondary row (Total Places / In-Review Pending Places) — keep all 7 cards distinct */
.stats-row-secondary .stat-card:nth-child(1) {
    background: linear-gradient(135deg, #06B6D4 0%, #0894ad 100%);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.3);
}

.stats-row-secondary .stat-card:nth-child(1):hover {
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.45);
}

.stats-row-secondary .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #6366F1 0%, #4f51d6 100%);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.stats-row-secondary .stat-card:nth-child(2):hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.45);
}

/* stat-icon removed (emojis no longer used) */

.stat-value {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stat-label {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.chart-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 32px;
    border: 2px solid #e2e8f0;
}

.chart-section h2 {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.chart-scroll-wrapper {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.area-stats-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    border: 2px solid #e2e8f0;
}

.area-stats-section h2 {
    border-bottom: none;
    margin-bottom: 4px;
    padding-bottom: 0;
}

.area-stats-section .subtitle {
    margin-bottom: 16px;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: countUp 0.5s ease-out both;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.4s;
}

/* ───── Place-Instagram Tab ───── */
.place-instagram-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.place-instagram-toolbar input {
    flex: 1;
    min-width: 250px;
    padding: 10px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
}

.place-instagram-toolbar select {
    padding: 10px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.results-info {
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
}

.instagram-input {
    width: 100%;
    padding: 6px 10px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    transition: border-color 0.2s;
}

.instagram-input:focus {
    border-color: #467ee8 !important;
    box-shadow: 0 0 0 3px rgba(70, 126, 232, 0.1) !important;
}

.instagram-empty-input {
    border-color: #ff8fa0 !important;
    background: #fff5f5 !important;
}

.instagram-empty-input::placeholder {
    color: #FF5271;
    font-style: italic;
}

.btn-preview-instagram {
    background: #467ee8 !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    white-space: nowrap;
    margin-right: 4px !important;
}

.btn-preview-instagram:hover:not(:disabled) {
    background: #3568d0 !important;
}

.btn-update-instagram {
    background: #1EC298 !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

.btn-update-instagram:hover:not(:disabled) {
    background: #17a07d !important;
}

/* ───── Mobile Responsive ───── */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 70px;
    }

    .card {
        padding: 16px;
    }

    h1 {
        font-size: 20px;
    }

    /* Tabs → horizontally scrollable */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Grids → single column */
    .grid-2,
    .grid-4,
    .iframe-container,
    .comparison-container,
    .stats-hero {
        grid-template-columns: 1fr !important;
    }

    /* Tables → horizontal scroll */
    .data-table {
        display: block;
        overflow-x: auto;
    }

    /* .table-wrap zaten kaydırıyor; tablo gerçek tablo layout'unda kalsın */
    .table-wrap .data-table {
        display: table;
        overflow-x: visible;
    }

    /* Stat cards */
    .stat-value {
        font-size: 32px;
    }

    .stat-card {
        padding: 20px 16px;
    }

    /* Buttons */
    button {
        padding: 10px 18px;
        font-size: 14px;
        margin-right: 6px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .action-buttons button {
        width: 100%;
        margin-right: 0;
    }

    /* Place-Instagram toolbar */
    .place-instagram-toolbar input {
        min-width: auto;
        width: 100%;
    }

    .place-instagram-toolbar select {
        min-width: auto;
        width: 100%;
    }

    /* Chart section */
    .chart-section {
        padding: 16px;
    }

    .area-stats-section {
        padding: 16px;
    }
}