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

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #212529;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Admin header */
.admin-header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 0;
}

.admin-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-header__actions {
    display: flex;
    gap: 8px;
}

.admin-main {
    padding: 24px 0 48px;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.login-back {
    text-align: center;
    margin-top: 20px;
}

.login-back a {
    color: #6c757d;
    font-size: 0.875rem;
    text-decoration: none;
}

.login-back a:hover {
    color: #495057;
}

/* Forms */
.form-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.form-card__title {
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
}

.form-group--checkbox {
    display: flex;
    align-items: flex-end;
    padding-bottom: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Contoh pertanyaan rows */
.contoh-fieldset {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.contoh-fieldset legend {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 8px;
    color: #495057;
}

.contoh-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.contoh-row input {
    flex: 1;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.btn-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-outline {
    background: #fff;
    color: #495057;
    border-color: #ced4da;
}

.btn-outline:hover {
    background: #f8f9fa;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.admin-header .btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.admin-header .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 1.1rem;
}

/* Cards */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 16px;
}

.card--inactive {
    opacity: 0.6;
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card__title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.card__meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.card__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

.admin-table th {
    background: #f8f9fa;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

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

.row-inactive {
    opacity: 0.6;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.form-inline {
    display: inline;
    margin: 0;
}

.form-inline button {
    margin: 0;
}

.card__actions .form-inline {
    display: inline-flex;
}

/* Shortcut pill */
.shortcut-pill {
    display: inline-block;
    background: #e9ecef;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: #6c757d;
    background: #fff;
    border-radius: 8px;
}

.empty-state a {
    color: #4a90d9;
}

@media (max-width: 600px) {
    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        display: block;
        padding: 12px 16px;
        border-bottom: 1px solid #e9ecef;
    }

    .admin-table td {
        display: block;
        padding: 4px 0;
        border: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #6c757d;
        display: block;
        margin-bottom: 2px;
    }

    .actions-cell {
        margin-top: 8px;
    }
}
