/* ===== Admin Theme ===== */
.admin-body {
    justify-content: center;
    align-items: center;
    display: flex;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--light) 0%, #f6d9e6 100%);
}

/* ===== Login Page ===== */
.login-page {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    text-align: center;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.login-logo-text {
    color: var(--plum);
    font-weight: 900;
    font-size: 1.3rem;
}

.login-card {
    padding: 34px 30px;
    text-align: right;
    box-shadow: 0 14px 44px rgba(105, 54, 104, 0.22);
}

.login-card-head {
    text-align: center;
    margin-bottom: 20px;
}

.login-card-head h2 {
    color: var(--plum);
    font-weight: 900;
    margin: 0 0 4px;
}

.login-card-head .subtitle {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin: 0;
}

.login-form .field {
    margin-bottom: 16px;
}

.login-form .field label {
    color: var(--plum);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: block;
}

.input-icon {
    position: relative;
}

.input-icon svg {
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}

.input-icon input {
    width: 100%;
    border: 1.5px solid #f0c6dc;
    border-radius: 14px;
    padding: 12px 42px 12px 16px;
    font-size: 0.97rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 76, 167, 0.18);
}

.login-hint {
    margin-top: 16px;
    font-size: 0.78rem;
    color: #a893a6;
    text-align: center;
}

/* ===== Topbar ===== */
.admin-topbar {
    background: var(--plum);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 3px 16px rgba(27, 27, 58, 0.25);
}

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

.admin-brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-weight: 900;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.admin-brand {
    font-weight: 900;
    font-size: 1rem;
    display: block;
    line-height: 1.2;
}

.admin-brand-sub {
    font-size: 0.72rem;
    color: var(--pink-light);
    display: block;
}

.admin-topbar nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-topbar nav a {
    color: #f2dcea;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.admin-topbar nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.admin-topbar nav a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
}

.admin-topbar nav a.danger {
    color: #ffc1b8;
}

/* ===== Stats ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 26px 0 20px;
}

.stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 18px rgba(105, 54, 104, 0.1);
    border-inline-start: 5px solid var(--primary);
}

.stat-card-accent {
    border-inline-start-color: #ff3562;
}

.stat-card-soft {
    border-inline-start-color: #8f6f8e;
}

.stat-icon {
    font-size: 1.7rem;
}

.stat-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--plum);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-weight: 600;
}

/* ===== Toolbar ===== */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.search-form input {
    flex: 1;
    border: 1.5px solid #e5c3d8;
    border-radius: 14px;
    padding: 11px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 76, 167, 0.16);
}

/* ===== Buttons ===== */
.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    background: #ffd9e8;
    color: #d12f89;
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 76, 167, 0.25);
}

.btn-small svg {
    width: 14px;
    height: 14px;
}

.btn-view {
    background: #eef1ff;
    color: #4a56b3;
}

.btn-danger {
    background: #fdeceb;
    color: #a3332b;
}

.btn-ghost {
    background: #f6ebf3;
    color: #693668;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--primary-darker));
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(247, 76, 167, 0.4);
}

.btn-export svg {
    width: 16px;
    height: 16px;
}

.btn-export-alt {
    background: #fff;
    color: #d12f89;
    border: 1.5px solid #f4a6d0;
}

.btn-export-alt:hover {
    background: #ffe6f2;
}

/* ===== Card / Table ===== */
.admin-card {
    padding: 0;
    overflow: hidden;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #f3e2f0;
}

.card-head h3 {
    margin: 0;
    color: var(--plum);
    font-weight: 900;
}

.card-badge {
    background: #fae7f3;
    color: #a34c8b;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 18px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-icon {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 10px;
}

.empty-msg {
    text-align: center;
    color: var(--text-soft);
    font-weight: 600;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
}

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

.admin-table th {
    background: #fae7f3;
    color: #9c3d82;
    padding: 12px 12px;
    white-space: nowrap;
    font-size: 0.82rem;
    text-align: right;
}

.th-sort {
    color: #9c3d82;
    text-decoration: none;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.15s;
}

.th-sort:hover {
    background: #f2d6e7;
    color: #6b1f57;
}

.th-sort.active {
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
}

.th-sort.active:hover {
    background: var(--primary-darker);
    color: #fff;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #f3e2f0;
    white-space: nowrap;
    color: #4a3a48;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: #fff3fa;
}

.cell-id {
    color: #b39ab0;
    font-weight: 700;
}

.cell-name {
    font-weight: 700;
    color: var(--plum);
}

.cell-phone {
    font-variant-numeric: tabular-nums;
    color: #4a3a48;
}

.cell-date {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.gender-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
}

.gender-m {
    background: #e8f0ff;
    color: #2f5fb3;
}

.gender-f {
    background: #ffe6f0;
    color: #c03a86;
}

.admin-table .actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-table .actions form {
    margin: 0;
    display: inline;
}

/* ===== View page ===== */
.view-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 22px;
    border-bottom: 1px solid #f3e2f0;
}

.view-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--plum));
    color: #fff;
    font-weight: 900;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(247, 76, 167, 0.4);
}

.view-title {
    flex: 1;
    min-width: 180px;
}

.view-title h2 {
    margin: 0;
    color: var(--plum);
    font-weight: 900;
}

.view-title p {
    margin: 2px 0 0;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 10px 22px 22px;
}

.view-item {
    padding: 14px 0;
    border-bottom: 1px solid #f6edf3;
    margin-inline-end: 24px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.view-item.view-full {
    grid-column: 1 / -1;
}

.view-label {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.view-value {
    color: var(--plum);
    font-weight: 700;
    font-size: 0.98rem;
    word-break: break-word;
    white-space: normal;
}

.view-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.muted {
    color: #c9b4c7;
}

/* ===== Options page ===== */
.options-intro {
    margin: 26px 0 16px;
}

.options-intro h2 {
    margin: 0 0 6px;
    color: var(--plum);
    font-weight: 900;
}

.options-cat {
    margin-bottom: 18px;
    padding: 22px;
}

.options-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 2px solid #f3e2f0;
    padding-bottom: 12px;
}

.options-cat-head h3 {
    margin: 0;
    color: var(--primary-darker);
    font-weight: 900;
}

.options-count {
    font-size: 0.82rem;
    color: #a34c8b;
    background: #fae7f3;
    padding: 4px 14px;
    border-radius: 18px;
    font-weight: 700;
}

.option-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #fbf4f9;
    border: 1px solid #f3e2f0;
    border-radius: 14px;
    padding: 10px 16px;
    transition: background 0.15s;
}

.option-row:hover {
    background: #fff3fa;
}

.option-row form {
    margin: 0;
}

.option-label {
    color: #4a3a48;
    font-weight: 600;
    word-break: break-word;
}

.add-option-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.add-option-form input[type="text"] {
    flex: 1;
    min-width: 220px;
    border: 1.5px solid #f0c6dc;
    border-radius: 14px;
    padding: 11px 16px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.add-option-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 76, 167, 0.16);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .view-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-form {
        min-width: 0;
    }
    .export-group {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-export,
    .btn-export-alt {
        text-align: center;
        padding: 13px 20px;
        font-size: 1rem;
        justify-content: center;
    }
    .search-form input {
        font-size: 16px;
    }
    .admin-table {
        font-size: 0.85rem;
    }
    .table-wrap {
        -webkit-overflow-scrolling: touch;
    }
    .admin-topbar .container {
        justify-content: center;
        text-align: center;
    }
    .admin-brand-wrap {
        justify-content: center;
    }
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .add-option-form input[type="text"] {
        min-width: 0;
    }
    .add-option-form .btn-export {
        width: 100%;
        text-align: center;
    }
}
