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

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

.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: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.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: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 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: #667eea;
    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: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

.btn-secondary {
    background: #48bb78;
}

.btn-secondary:hover:not(:disabled) {
    background: #38a169;
}

.btn-danger {
    background: #e53e3e;
}

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

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

.btn-control:hover:not(:disabled) {
    background: #3182ce;
}

.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: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

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

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

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

.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;
}

.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;
}

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

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

.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: #fff5e6;
    border: 2px solid #ffa726;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.editable-section h3 {
    color: #e65100;
    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: #4299e1;
}

.panel-existing h3 {
    color: #2c5282;
}

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

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

.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: #ccff00;
    color: #1a202c !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(204, 255, 0, 0.6);
    transition: all 0.3s ease;
}

.lukal-info-btn:hover:not(:disabled) {
    background: #d4ff2a;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.8);
}

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

.stat-card {
    background: linear-gradient(135deg, #6b8f4a 0%, #4a6f2f 100%);
    border-radius: 16px;
    padding: 28px 24px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(107, 143, 74, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(107, 143, 74, 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, #7a9f5a 0%, #5a7f3a 100%);
    box-shadow: 0 8px 32px rgba(122, 159, 90, 0.3);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 12px 40px rgba(122, 159, 90, 0.45);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #8aaf6a 0%, #6a8f4a 100%);
    box-shadow: 0 8px 32px rgba(138, 175, 106, 0.3);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 12px 40px rgba(138, 175, 106, 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;
}

/* ───── 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: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

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

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

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

.btn-update-instagram:hover:not(:disabled) {
    background: #38a169 !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;
    }

    /* 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;
    }
}