*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --kh-yellow: #f4dd0a;
    --kh-dark: #232538;
    --kh-bg: #f5f7fb;
    --kh-text: #1f2430;
    --kh-muted: #6b7280;
    --kh-border: #d9dee7;
    --kh-white: #ffffff;
    --kh-danger: #b00020;
    --kh-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --kh-shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.10);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: var(--kh-bg);
    color: var(--kh-text);
}

/* Base */
h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

a {
    color: inherit;
}

input,
select,
button,
textarea {
    font: inherit;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4dd0a 0%, #f7e84d 100%);
    padding: 24px;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--kh-white);
    padding: 36px;
    border-radius: 20px;
    box-shadow: var(--kh-shadow-lg);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.1;
    color: var(--kh-dark);
}

.login-card p {
    margin: 0 0 24px;
    color: var(--kh-muted);
    font-size: 15px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card input,
.login-card button {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
}

.login-card input {
    border: 1px solid var(--kh-border);
    background: #fff;
    color: var(--kh-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card input:focus {
    border-color: var(--kh-dark);
    box-shadow: 0 0 0 3px rgba(35, 37, 56, 0.08);
}

.login-card button {
    border: none;
    background: var(--kh-dark);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.login-card button:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.login-card button:active {
    transform: translateY(0);
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(176, 0, 32, 0.08);
    color: var(--kh-danger);
    font-size: 14px;
}

/* App layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--kh-bg);
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--kh-dark);
    color: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar h2 {
    margin: 0 0 24px;
    font-size: 28px;
}

.sidebar nav,
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar a {
    color: #fff;
    text-decoration: none;
    display: block;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar a.active {
    background: rgba(244, 221, 10, 0.16);
    color: #fff;
}

.main {
    flex: 1;
    padding: 30px;
    min-width: 0;
}

/* Top sections */
.topbar h1 {
    margin: 0 0 8px;
}

.topbar p {
    margin: 0;
    color: var(--kh-muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 8px;
}

.page-header p {
    margin: 0;
    color: var(--kh-muted);
}

.header-search input {
    width: 280px;
    height: 46px;
    border: 1px solid var(--kh-border);
    border-radius: 999px;
    padding: 0 16px;
    background: #fff;
    outline: none;
}

.header-search input:focus {
    border-color: var(--kh-dark);
    box-shadow: 0 0 0 3px rgba(35, 37, 56, 0.08);
}

/* Pills */
.tab-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tab-pills a {
    text-decoration: none;
    background: #ffe94d;
    color: #222;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
}

/* Cards and panels */
.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.card,
.list-panel,
.search-panel,
.map-card,
.info-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--kh-shadow);
}

.card {
    border-radius: 16px;
    padding: 24px;
}

.card h3 {
    margin: 0;
    font-size: 15px;
    color: var(--kh-muted);
    font-weight: 600;
}

.card strong {
    font-size: 32px;
    display: block;
    margin-top: 12px;
    color: var(--kh-dark);
}

.list-panel h2,
.search-panel h2,
.map-card h2,
.info-card h2 {
    margin: 0 0 16px;
}

/* Hero */
.hero-banner {
    background: linear-gradient(135deg, #2d3148 0%, #454b6b 100%);
    color: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
}

.hero-banner h1,
.hero-banner h2 {
    margin: 8px 0;
}

.hero-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.chip {
    display: inline-block;
    background: var(--kh-yellow);
    color: #111;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Split grids */
.split-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Search page */
.search-panel {
    margin-bottom: 24px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.search-grid select,
.search-grid input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--kh-border);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    outline: none;
}

.search-grid select:focus,
.search-grid input:focus {
    border-color: var(--kh-dark);
    box-shadow: 0 0 0 3px rgba(35, 37, 56, 0.08);
}

.primary-btn {
    height: 48px;
    border: none;
    border-radius: 999px;
    background: var(--kh-dark);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.primary-btn:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Lists */
.result-list {
    display: grid;
    gap: 12px;
}

.result-card,
.chat-row,
.update-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #eef1f6;
}

.result-card:last-child,
.chat-row:last-child,
.update-card:last-child {
    border-bottom: none;
}

.result-card h3,
.chat-copy h3,
.update-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.result-card p,
.chat-copy p,
.update-card p,
.empty-note {
    margin: 0;
    color: var(--kh-muted);
}

.result-meta {
    text-align: right;
    flex-shrink: 0;
}

.result-meta strong {
    display: block;
    margin-top: 6px;
}

.update-thumb {
    width: 88px;
    height: 68px;
    flex: 0 0 88px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dfe7f7 0%, #f7f9fc 100%);
}

/* Quick links */
.quick-links {
    display: grid;
    gap: 12px;
}

.quick-link {
    display: block;
    text-decoration: none;
    background: #f7f9fc;
    border: 1px solid #edf1f7;
    color: var(--kh-dark);
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.quick-link:hover {
    background: #f1f5fb;
    border-color: #dde6f1;
}

/* Map */
.map-card {
    margin-top: 0;
}

.map-placeholder {
    min-height: 260px;
    border-radius: 16px;
    background: linear-gradient(135deg, #d7ecff 0%, #f7f0c2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: rgba(31, 36, 48, 0.22);
}

/* Developer */
.developer-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.developer-logo-box,
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--kh-dark);
    flex-shrink: 0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 10px 0;
    border-bottom: 1px solid #eef1f6;
    vertical-align: top;
}

/* Circles */
.chat-row {
    align-items: center;
}

.chat-copy {
    flex: 1;
    min-width: 0;
}

.chat-time {
    color: var(--kh-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 992px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-grid,
    .info-grid,
    .search-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-search {
        width: 100%;
    }

    .header-search input {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 24px;
        border-radius: 16px;
    }

    .dashboard-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .main {
        padding: 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .result-card,
    .chat-row,
    .update-card,
    .developer-hero,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-meta,
    .chat-time {
        text-align: left;
    }

    .map-placeholder {
        min-height: 200px;
        font-size: 42px;
    }
}

.developer-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.developer-list-panel,
.developer-detail-panel {
    min-width: 0;
}

.developer-list-panel {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--kh-shadow);
    align-self: start;
}

.developer-list {
    display: grid;
    gap: 10px;
}

.developer-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--kh-text);
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #edf1f7;
}

.developer-list-item.active {
    background: rgba(244, 221, 10, 0.18);
    border-color: rgba(244, 221, 10, 0.35);
}

.developer-mini-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.developer-list-copy {
    min-width: 0;
}

.developer-list-copy strong,
.developer-list-copy span {
    display: block;
}

.developer-list-copy span {
    margin-top: 4px;
    color: var(--kh-muted);
    font-size: 13px;
}

@media (max-width: 992px) {
    .developer-layout {
        grid-template-columns: 1fr;
    }
}

.developer-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.developer-list-header span {
    color: var(--kh-muted);
    font-size: 13px;
    white-space: nowrap;
}

.developer-search-form {
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 10px;
    margin-bottom: 16px;
}

.developer-search-form input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--kh-border);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    outline: none;
}

.developer-search-form input:focus {
    border-color: var(--kh-dark);
    box-shadow: 0 0 0 3px rgba(35, 37, 56, 0.08);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef1f6;
}

.page-link {
    text-decoration: none;
    background: #f7f9fc;
    border: 1px solid #edf1f7;
    color: var(--kh-dark);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
}

.page-status {
    color: var(--kh-muted);
    font-size: 14px;
}

@media (max-width: 640px) {
    .developer-search-form {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .page-link {
        text-align: center;
    }
}