@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f9fafb;
    --line: #e5e7eb;
    --line-strong: #d1d5db;
    --text: #111827;
    --muted: #6b7280;
    --primary: #10b981;
    --primary-strong: #059669;
    --info: #2563eb;
    --danger: #dc2626;
    --warning: #f59e0b;
    --neutral: #6b7280;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.08), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

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

img {
    max-width: 100%;
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(249, 250, 251, 0.9);
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

select[hidden] {
    display: none !important;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

select option {
    color: #111827;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

button {
    border: 0;
    cursor: pointer;
}

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

.sidebar {
    padding: 24px;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px 18px;
    margin-bottom: 12px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: white;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    box-shadow: var(--shadow);
}

.brand-title {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
    text-transform: capitalize;
}

.nav {
    display: grid;
    gap: 8px;
    margin: 16px 0 24px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--text);
    background: transparent;
    transition: 150ms ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.12);
    color: var(--primary-strong);
}

.content {
    padding: 28px;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-head h1,
.auth-header h1,
.panel h2 {
    margin: 0;
}

.page-head h1 {
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.03em;
}

.page-head p,
.auth-header p,
.stat-card span,
.meta {
    color: var(--muted);
}

.panel,
.stat-card,
.auth-card,
.welcome-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.panel,
.auth-card,
.welcome-card {
    border-radius: 18px;
}

.panel {
    padding: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px;
    border-radius: 16px;
    display: grid;
    gap: 8px;
}

.stat-card strong {
    font-size: 28px;
    letter-spacing: -0.04em;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 460px);
    padding: 32px;
}

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

.auth-header .brand-mark {
    margin: 0 auto 14px;
}

.auth-form {
    display: grid;
    gap: 16px;
    align-items: start;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.auth-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    align-self: start;
}

.searchable-select {
    position: relative;
    display: grid;
    gap: 8px;
}

.searchable-select__control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    box-shadow: none;
}

.searchable-select__control:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.searchable-select__value {
    flex: 1;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.searchable-select__chevron {
    color: var(--muted);
    font-size: 12px;
    flex: none;
}

.searchable-select__panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.searchable-select__search {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none !important;
}

.searchable-select__options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
    display: grid;
    gap: 4px;
}

.searchable-select__option {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    font-weight: 400;
    min-height: 40px;
}

.searchable-select__option:hover,
.searchable-select__option.is-selected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-strong);
}

.auth-form label.full-width {
    grid-column: 1 / -1;
}

.field-hint {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.auth-form > button,
.auth-form > .form-actions,
.auth-form > .page-actions,
.auth-form > .row-actions {
    grid-column: 1 / -1;
}

.auth-form > button,
.auth-form > .form-actions {
    align-self: start;
}

.auth-form > .form-actions,
.auth-form > .page-actions,
.auth-form > .row-actions {
    width: 100%;
}

.form-actions,
.page-actions,
.row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.row-actions {
    row-gap: 8px;
}

.row-actions form {
    display: inline-block;
}

.chart-frame {
    position: relative;
    width: 100%;
    height: clamp(240px, 35vw, 360px);
    margin-top: 16px;
}

.qr-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.qr-copy {
    display: grid;
    gap: 10px;
    flex: 1 1 280px;
}

.qr-preview {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.qr-preview img {
    width: 220px;
    height: 220px;
    background: white;
    padding: 10px;
    border-radius: 14px;
}

.qr-preview small {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.photo-card {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px);
    gap: 20px;
    align-items: center;
}

.photo-copy {
    display: grid;
    gap: 10px;
}

.photo-preview,
.photo-placeholder {
    min-height: 220px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    padding: 20px;
    color: var(--muted);
    text-align: center;
    font-weight: 600;
}

.section-gap {
    margin-bottom: 16px;
}

.section-top {
    margin-top: 16px;
}

.mb-18 {
    margin-bottom: 18px;
}

.mt-24 {
    margin-top: 24px;
}

.welcome-shell {
    width: min(100%, 960px);
    padding: 34px;
}

.primary-button,
.secondary-button,
.logout-button,
.auth-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.primary-button {
    color: white;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.18);
}

.secondary-button {
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.logout-button {
    width: 100%;
    color: var(--danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.primary-button:hover,
.secondary-button:hover,
.logout-button:hover,
.auth-form button:hover {
    transform: translateY(-1px);
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

tbody tr:hover {
    background: #f9fafb;
}

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    background: #f3f4f6;
    border: 1px solid var(--line);
}

.badge-success,
.status-aktif {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #065f46;
}

.badge-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.badge-danger,
.status-nonaktif {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.badge-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--info);
}

.badge-neutral {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: var(--neutral);
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination a,
.pagination span,
nav[aria-label='Pagination Navigation'] a,
nav[aria-label='Pagination Navigation'] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

nav[aria-label='Pagination Navigation'] span[aria-current='page'],
.pagination .active span {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.14);
    color: var(--primary-strong);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: center;
}

.hero-copy h1 {
    font-size: clamp(36px, 5vw, 54px);
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 14px;
}

.hero-copy p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
    max-width: 56ch;
}

.hero-metric {
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.hero-metric strong {
    font-size: 36px;
    letter-spacing: -0.04em;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

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

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

@media (max-width: 720px) {
    .content,
    .sidebar {
        padding: 18px;
    }

    .auth-card {
        padding: 22px;
    }

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

    .page-head {
        align-items: start;
        flex-direction: column;
    }

    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .form-grid-5,
    .form-grid-6 {
        grid-template-columns: 1fr;
    }

    .page-actions,
    .form-actions,
    .row-actions {
        width: 100%;
    }

    .page-actions .primary-button,
    .page-actions .secondary-button,
    .form-actions .primary-button,
    .form-actions .secondary-button {
        width: 100%;
    }

    .welcome-shell {
        width: 100%;
        padding: 20px;
    }

    .chart-frame {
        height: 260px;
    }
}
