/* ============================================================
   Brankas Akun — Modern App Shell
   Sidebar gelap (drawer di HP), kartu lembut, tabel responsif.
   ============================================================ */

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --violet: #7c3aed;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --border: #e5e9f2;
    --border-soft: #eef2f7;
    --bg: #f4f6fb;
    --card: #ffffff;
    --success: #047857;
    --success-soft: #d1fae5;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --info: #1d4ed8;
    --info-soft: #dbeafe;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 36px rgba(15, 23, 42, 0.06);
    --sidebar-width: 268px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

h1,
h2,
h3 {
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem);
    font-weight: 800;
}

h2 {
    font-size: 1.08rem;
    font-weight: 700;
}

p {
    margin: 0 0 10px;
}

code {
    padding: 2px 7px;
    border-radius: 7px;
    background: #eef2f7;
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 0.88em;
    color: #334155;
}

.muted {
    color: var(--muted);
}

.text-right {
    text-align: right;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 0.9rem;
}

/* ------------------------------ Shell & sidebar ------------------------------ */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 20px 16px;
    overflow-y: auto;
    color: #cbd5e1;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0) 55%),
        linear-gradient(180deg, #111827 0%, #0b1120 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #f8fafc;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: #ffffff;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
}

.brand-logo svg {
    width: 21px;
    height: 21px;
}

.brand-text {
    font-size: 1.05rem;
    line-height: 1.1;
}

.brand-text span {
    color: #a5b4fc;
}

.sidebar-close {
    display: none;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 24px;
}

.side-label {
    padding: 0 12px;
    margin-bottom: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #64748b;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.side-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.side-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.side-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0.1) 100%);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
}

.side-link.active svg {
    color: #a5b4fc;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 6px;
}

.side-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.side-user-info strong {
    overflow: hidden;
    font-size: 0.86rem;
    font-weight: 600;
    color: #e2e8f0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user-info small {
    font-size: 0.74rem;
    color: #64748b;
}

.avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: 0.74rem;
    box-shadow: none;
}

.sidebar-logout {
    margin: 14px 0 0;
}

.btn-logout {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

.btn-logout:hover {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: none;
    align-items: center;
    gap: 12px;
    height: 62px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-brand {
    flex: 1;
    overflow: hidden;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--text);
}

.sidebar .icon-btn {
    color: #94a3b8;
}

.sidebar .icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 32px 30px 44px;
}

.footer {
    padding: 18px 24px 26px;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* ------------------------------ Page head ------------------------------ */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-head h1 {
    margin-bottom: 4px;
}

.page-head p {
    margin: 0;
    font-size: 0.94rem;
}

.page-head > div > .muted + .muted {
    margin-top: 6px;
}

.head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ------------------------------ Stats ------------------------------ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, #ffffff 0%, #fbfcff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    content: "";
    background: radial-gradient(circle, rgba(99, 102, 241, 0.09) 0%, rgba(99, 102, 241, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon-indigo {
    color: #4f46e5;
    background: #eef2ff;
}

.stat-icon-cyan {
    color: #0891b2;
    background: #ecfeff;
}

.stat-icon-violet {
    color: #7c3aed;
    background: #f5f3ff;
}

.stat-icon-emerald {
    color: #047857;
    background: #d1fae5;
}

.stat-icon-amber {
    color: #b45309;
    background: #fef3c7;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
}

.stat-value-sm {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--text-soft);
}

/* ------------------------------ Cards ------------------------------ */

.card {
    padding: 22px;
    margin-bottom: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.card-head h2 {
    margin: 0;
}

.card > h2 {
    margin-bottom: 14px;
}

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

.grid-2 .card {
    margin-bottom: 0;
}

.grid-2 > .card:first-child {
    grid-row: span 2;
}

/* ------------------------------ Buttons ------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-soft);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
        box-shadow 0.18s ease, transform 0.18s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.36);
    transform: translateY(-1px);
}

.btn-outline {
    color: var(--text-soft);
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    color: var(--primary);
    border-color: #c7d2fe;
    background: #fbfbff;
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--text);
    background: #f1f5f9;
}

.btn-danger {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.btn-danger:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-sm {
    padding: 6px 11px;
    border-radius: 9px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

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

/* ------------------------------ Forms ------------------------------ */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-soft);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select {
    width: 100%;
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.94rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
    color: #94a3b8;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.hint {
    display: block;
    margin-top: 6px;
    font-size: 0.79rem;
    color: var(--muted);
}

.required {
    color: #dc2626;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-card {
    max-width: 800px;
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.input-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    position: relative;
    flex: 0 1 320px;
    min-width: 190px;
}

.search-input svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 17px;
    height: 17px;
    color: #94a3b8;
    pointer-events: none;
    transform: translateY(-50%);
}

.search-input input {
    padding-left: 39px;
}

/* ------------------------------ Tables ------------------------------ */

.table-wrap {
    margin: 0 -22px;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

thead th {
    padding: 11px 22px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f8fafc;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

tbody td {
    padding: 14px 22px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-soft);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #fafbff;
}

tbody td.empty {
    padding: 36px 22px;
    color: var(--muted);
    text-align: center;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-left: 6px;
}

.actions .btn:first-child {
    margin-left: 0;
}

.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 18px;
}

.table-foot .muted {
    font-size: 0.84rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: var(--primary);
    background: var(--primary-soft);
}

.empty-icon svg {
    width: 26px;
    height: 26px;
}

/* ------------------------------ Secret cells ------------------------------ */

.url-link {
    word-break: break-all;
}

.secret-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.secret {
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    letter-spacing: 2px;
    color: var(--muted);
    word-break: break-all;
}

.secret-actions {
    display: flex;
    gap: 2px;
}

.vault-note {
    margin: 20px 0 0;
    padding-top: 14px;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px dashed var(--border);
}

/* ------------------------------ Badges & alerts ------------------------------ */

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-primary {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.badge-muted {
    color: var(--muted);
    background: #eef2f7;
}

.badge-success {
    color: var(--success);
    background: var(--success-soft);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.badge-info {
    color: var(--info);
    background: var(--info-soft);
}

.alert {
    padding: 13px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-radius: 13px;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-success {
    color: var(--success);
    background: #ecfdf5;
    border-color: #a7f3d0;
}

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

.alert-warning {
    color: var(--warning);
    background: #fffbeb;
    border-color: #fde68a;
}

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

/* ------------------------------ Pagination ------------------------------ */

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

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.page-link:hover {
    color: var(--primary);
    border-color: #c7d2fe;
}

.page-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: transparent;
}

/* ------------------------------ Detail list ------------------------------ */

.detail-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 16px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
    color: var(--text-soft);
    word-break: break-word;
}

/* ------------------------------ Auth pages ------------------------------ */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 36px 16px;
    background:
        radial-gradient(60% 50% at 12% 15%, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 100%),
        radial-gradient(55% 45% at 88% 85%, rgba(14, 165, 233, 0.14) 0%, rgba(14, 165, 233, 0) 100%),
        linear-gradient(180deg, #f7f8fd 0%, #eef1fa 100%);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 36px 32px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(30, 41, 59, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-card-wide {
    max-width: 540px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    font-size: 1.65rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.auth-card h1 {
    margin-bottom: 6px;
    font-size: 1.5rem;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: center;
}

.auth-hint {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ------------------------------ Focus ------------------------------ */

.btn:focus-visible,
.icon-btn:focus-visible,
.side-link:focus-visible,
.page-link:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.4);
    outline-offset: 2px;
}

/* ------------------------------ Responsive ------------------------------ */

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

@media (max-width: 960px) {
    .sidebar {
        width: min(300px, 84vw);
        transform: translateX(-104%);
        transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 30px 0 60px rgba(15, 23, 42, 0.3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .container {
        padding: 24px 20px 38px;
    }

    body.nav-open {
        overflow: hidden;
    }
}

@media (max-width: 760px) {
    .container {
        padding: 20px 15px 32px;
    }

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

    .grid-2 > .card:first-child {
        grid-row: auto;
    }

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

    .card {
        padding: 18px;
        border-radius: 16px;
    }

    .card-head {
        margin-bottom: 14px;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        flex: 1 1 auto;
        width: 100%;
    }

    .page-head {
        margin-bottom: 18px;
    }

    .detail-list {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .detail-list dt {
        margin-top: 10px;
    }

    .detail-list dt:first-child {
        margin-top: 0;
    }

    .detail-list dd {
        margin-bottom: 4px;
    }

    /* Tabel berubah menjadi daftar kartu */

    .table-wrap {
        margin: 0;
        overflow: visible;
    }

    table {
        min-width: 0;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody tr {
        padding: 14px 15px;
        margin-bottom: 12px;
        background: #fbfcff;
        border: 1px solid var(--border);
        border-radius: 14px;
    }

    tbody tr:last-child {
        margin-bottom: 0;
    }

    tbody tr:hover {
        background: #fbfcff;
    }

    tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 8px 0;
        text-align: right;
        border-bottom: 1px dashed var(--border-soft);
    }

    tbody td:last-child {
        border-bottom: none;
    }

    tbody td::before {
        flex-shrink: 0;
        padding-top: 2px;
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-align: left;
        text-transform: uppercase;
    }

    tbody td.empty {
        display: block;
        padding: 24px 6px;
        text-align: center;
        border-bottom: none;
    }

    tbody td.empty::before {
        display: none;
    }

    tbody td.actions {
        justify-content: flex-end;
        gap: 8px;
        padding-top: 12px;
    }

    tbody td.actions::before {
        display: none;
    }

    .actions .btn {
        margin-left: 0;
    }

    .secret-cell {
        justify-content: flex-end;
    }

    .table-foot {
        padding-top: 16px;
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-top {
        gap: 8px;
        margin-bottom: 10px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .stat-icon svg {
        width: 17px;
        height: 17px;
    }

    .stat-label {
        font-size: 0.66rem;
    }

    .stat-value {
        font-size: 1.55rem;
    }

    .stat-value-sm {
        font-size: 0.9rem;
    }

    .page-head .btn,
    .head-actions,
    .head-actions .btn {
        width: 100%;
    }

    .head-actions .btn {
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .input-with-button {
        flex-wrap: wrap;
    }

    .input-with-button input {
        flex: 1 0 100%;
    }

    .input-with-button .btn {
        width: 100%;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 20px;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .secret-cell {
        flex-direction: column;
        align-items: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
