/* ── Depth: subtle gradient instead of flat blue ── */
.app-content {
    background: radial-gradient(circle at top left, #2a63f0 0%, #1c55e6 55%, #163fb0 100%);
}

/* ── Page head ── */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.5s ease forwards;
    animation-delay: 0.05s;
}

.page-head-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.page-head-info .btn-primary {
    align-self: flex-end;
}

.page-head h2 {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.page-sub {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    border: none;
    background: #ffffff;
    color: #181bdb;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: scale(0.94);
}

.btn-primary svg {
    transition: transform 0.15s ease;
}

.btn-primary:hover svg {
    transform: rotate(90deg);
}

/* ── Toolbar (stat + search) ── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.5s ease forwards;
    animation-delay: 0.15s;
}

.stat-pill {
    background: #ffff;
    border: 0.5px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-num {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.stat-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
}

/* ── Search box ── */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 0.5px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 0 14px;
    height: 42px;
    width: 240px;
    color: rgba(255,255,255,0.85);
    transition: border-color 0.15s ease, background 0.15s ease, width 0.2s ease;
}

.search-box:focus-within {
    border-color: #ffffff;
    background: rgba(255,255,255,0.22);
    width: 270px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    color: #ffffff;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    width: 100%;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

/* ── Table card ── */
.table-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.5s ease forwards;
    animation-delay: 0.25s;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
}

.user-table thead th {
    text-align: left;
    padding: 14px 20px;
    background: #f7f8fa;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #eceef1;
}

.user-table td {
    padding: 14px 20px;
    color: #111111;
    border-bottom: 1px solid #f2f3f5;
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Sortable header ── */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: #181bdb;
}

.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#sortIcon {
    transition: transform 0.2s ease;
}

/* ── Row entrance + hover lift ── */
.user-table tbody tr {
    opacity: 0;
    animation: rowIn 0.4s ease forwards;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

@keyframes rowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.user-table tbody tr:hover {
    transform: translateY(-2px) scale(1.003);
    box-shadow: 0 6px 16px rgba(24, 27, 219, 0.08);
    position: relative;
    z-index: 1;
    background: #fafbfe;
}

.user-table tbody tr:hover .avatar {
    transform: scale(1.08);
}

/* ── User cell (avatar + name) ── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #ffffff;
    font-family: 'Syne', sans-serif;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

/* ── RFID chip badge ── */
.rfid-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef1fd;
    color: #181bdb;
    border: 0.5px solid #c7cef7;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    letter-spacing: 0.03em;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rfid-chip:hover {
    box-shadow: 0 0 0 4px rgba(24, 27, 219, 0.08);
    transform: translateY(-1px);
}

/* ── Phone chip badge (matches RFID pairing) ── */
.phone-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eafaf1;
    color: #1a9e5c;
    border: 0.5px solid #b9ecd2;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    letter-spacing: 0.03em;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.phone-chip:hover {
    box-shadow: 0 0 0 4px rgba(26, 158, 92, 0.08);
    transform: translateY(-1px);
}

/* ── Actions ── */
.action-cell {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 0.5px solid #e2e4e9;
    background: #ffffff;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

.btn-icon:hover {
    border-color: #181bdb;
    color: #181bdb;
    background: #eef1fd;
}

.btn-icon:active {
    transform: scale(0.94);
}

.btn-icon-danger:hover {
    border-color: #e63946;
    color: #e63946;
    background: #fdecec;
}

/* ── No result state ── */
.no-result {
    text-align: center;
    padding: 30px 0;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: #9aa0ab;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 40, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 26px;
    width: 360px;
    font-family: 'DM Mono', monospace;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: scale(0.92) translateY(10px);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.modal-head h3 {
    font-family: 'Syne', sans-serif;
    font-size: 17px;
    color: #111111;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.modal-box label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 0 5px;
    color: #6b7280;
}

.plain-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e2e4e9;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.12s ease;
}

.plain-input:focus {
    border-color: #181bdb;
}

/* RFID "scan" style input */
.scan-input {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px dashed #c7cef7;
    background: #f7f8fe;
    color: hsl(353, 96%, 48%);
    animation: scanPulse 2.4s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(24, 27, 219, 0.12); }
    50%      { box-shadow: 0 0 0 5px rgba(24, 27, 219, 0.06); }
}

.scan-input input {
    border: none;
    background: none;
    outline: none;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: #111111;
    width: 100%;
}

.scan-input-disabled {
    opacity: 0.55;
    background: #eceef2;
    animation: none;
}

.scan-input-disabled input {
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

.btn-cancel {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    background: #f2f3f5;
    border: none;
    color: #444;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-cancel:active {
    transform: scale(0.94);
}

/* ── Delete confirmation modal ── */
.confirm-box {
    width: 320px;
    text-align: center;
}

.confirm-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fdecec;
    color: #e63946;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.confirm-box h3 {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    color: #111111;
    margin-bottom: 8px;
}

.confirm-text {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.confirm-text strong {
    color: #111111;
}

.confirm-box .modal-actions {
    justify-content: center;
}

.btn-delete-confirm {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    background: #e63946;
    border: none;
    color: #ffffff;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.1s ease;
}

.btn-delete-confirm:hover {
    background: #d32f3d;
}

.btn-delete-confirm:active {
    transform: scale(0.94);
}

/* ── Toast notification ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111111;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 12.5px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 3px solid #6ee7b7;
}

.toast-success svg {
    color: #6ee7b7;
    flex-shrink: 0;
}

.toast-danger {
    border-left: 3px solid #e63946;
}

.toast-danger svg {
    color: #e63946;
    flex-shrink: 0;
}

/* ── Responsive: mobile card view ── */
@media (max-width: 768px) {

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box:focus-within {
        width: 100%;
    }

    .table-card {
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .user-table thead {
        display: none;
    }

    .user-table, .user-table tbody, .user-table tr, .user-table td {
        display: block;
        width: 100%;
    }

    .user-table tbody tr {
        background: #ffffff;
        border-radius: 12px;
        margin-bottom: 12px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.15);
        padding: 12px 16px;
    }

    .user-table tbody tr:hover {
        transform: none;
    }

    .user-table td {
        border-bottom: none;
        padding: 8px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .user-table td[data-label]::before {
        content: attr(data-label);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #9aa0ab;
        flex-shrink: 0;
    }

    .user-table td.action-cell::before {
        content: none;
    }

    .user-table td[data-label="User"]::before {
        content: none;
    }

    .user-table td[data-label="User"] {
        justify-content: flex-start;
        padding-bottom: 10px;
        border-bottom: 1px solid #f2f3f5;
    }

    .action-cell {
        justify-content: flex-end;
        padding-top: 10px;
    }
}