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

body {
    background: #f5f7fa;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.page { max-width: 1080px; margin: 0 auto; padding: 40px 28px 64px; }
.page-narrow { max-width: 720px; }

table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: #fff; border: 1px solid #e8ecf1; border-radius: 10px; overflow: hidden;
}
thead th {
    background: #f5f7fa; color: #8896a7; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; text-align: left;
    padding: 14px 18px; border-bottom: 1px solid #e8ecf1;
}
tbody td {
    padding: 14px 18px; border-bottom: 1px solid #f0f3f7; color: #666; font-size: 0.95rem;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f5f7fa; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status.active { background: #e8f8f0; color: #3a9d6a; }
.status.inactive { background: #fde8e8; color: #c0392b; }

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; color: #8896a7;
    background: #f0f3f7; border: 1px solid #e8ecf1; text-decoration: none; transition: 0.2s;
}
.btn-icon:hover { color: #5b8def; background: #eaf1fd; border-color: #c5d5f7; }
.btn-icon.delete-btn:hover { color: #e06c75; background: #fde8e8; border-color: #f3cdce; }
.row-actions { display: inline-flex; align-items: center; gap: 8px; }

.empty-state { text-align: center; padding: 48px 18px; color: #aab4c2; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty-state i { display: block; font-size: 2rem; margin-bottom: 10px; color: #ccd3dc; }
.empty-state p { margin: 0; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
    border-radius: 8px; font-size: 0.92rem; font-weight: 600; text-decoration: none;
    cursor: pointer; border: 1px solid transparent; transition: 0.2s; white-space: nowrap;
}
.btn-primary { background: #5b8def; color: #fff; }
.btn-primary:hover { background: #4a7de0; }
.btn-ghost { background: #fff; color: #7a8599; border-color: #dde2e9; }
.btn-ghost:hover { color: #5b8def; border-color: #a8c0f0; background: #f5f8ff; }
.btn-danger { background: #fde8e8; color: #c0392b; border-color: #f3cdce; }
.btn-danger:hover { background: #e06c75; color: #fff; border-color: #e06c75; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 12px; background: #eaf1fd; color: #5b8def; font-size: 1.2rem;
}
.eyebrow { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #aab4c2; }
.topbar h1 { margin: 2px 0 0; font-size: 1.4rem; font-weight: 700; color: #555; }

.summary-card {
    display: flex; align-items: center; gap: 18px; background: #fff;
    border: 1px solid #e8ecf1; border-radius: 10px; padding: 22px 24px; margin-bottom: 24px;
}
.summary-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%; background: #eaf1fd; color: #5b8def; font-size: 2rem; flex-shrink: 0;
}
.summary-body h2 { margin: 0 0 6px; font-size: 1.3rem; color: #555; }
.summary-meta { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; list-style: none; color: #7a8599; font-size: 0.9rem; }
.summary-meta li { display: inline-flex; align-items: center; gap: 7px; }

.panel { background: #fff; border: 1px solid #e8ecf1; border-radius: 10px; padding: 26px 28px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; color: #555; display: inline-flex; align-items: center; gap: 9px; }
.muted { margin: 4px 0 0; color: #aab4c2; font-size: 0.88rem; }

.edit-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: #666; display: inline-flex; align-items: center; gap: 8px; }
.form-group input {
    width: 100%; padding: 12px 14px; border: 1px solid #dde2e9; border-radius: 8px;
    background: #f5f7fa; color: #666; font-size: 0.95rem; transition: 0.2s;
}
.form-group input:focus { outline: none; border-color: #5b8def; background: #fff; box-shadow: 0 0 0 3px #eaf1fd; }
.form-group input[readonly] { background: #f0f3f7; color: #7a8599; cursor: not-allowed; }
.hint { font-size: 0.8rem; color: #aab4c2; }
.input-with-toggle { position: relative; display: flex; align-items: center; }
.input-with-toggle input { padding-right: 46px; }
.btn-toggle {
    position: absolute; right: 8px; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: none; background: transparent; color: #aab4c2; cursor: pointer; border-radius: 8px; transition: 0.2s;
}
.btn-toggle:hover { color: #5b8def; background: #eaf1fd; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.topnav { display: flex; gap: 8px; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.danger-zone {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: #fde8e8; border: 1px solid #f3cdce; border-radius: 10px; padding: 20px 24px;
}
.danger-zone h3 { margin: 0 0 4px; font-size: 1rem; color: #c0392b; display: inline-flex; align-items: center; gap: 9px; }

@media (max-width: 640px) {
    .page { padding: 24px 16px 48px; }
    thead { display: none; }
    tbody td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e8ecf1; }
    tbody td::before { content: attr(data-label); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #aab4c2; }
    .topbar, .danger-zone { flex-direction: column; align-items: flex-start; }
    .form-row { grid-template-columns: 1fr; }
    .summary-card { flex-direction: column; text-align: center; }
    .summary-meta { justify-content: center; }

    .topnav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        width: 100%;
        margin: 0 -16px;
        padding: 2px 16px 6px;
    }
    .topnav::-webkit-scrollbar { display: none; }
    .topnav .btn { flex-shrink: 0; }

    .panel-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .form-actions { flex-wrap: wrap; justify-content: flex-start; }
    .row-actions { gap: 12px; }
    .btn-icon { width: 40px; height: 40px; }
}
