/* ══════════════════════════════════════════════════════════════
   PA Tual Admin Panel — style.css
   ══════════════════════════════════════════════════════════════ */

:root {
    --primary:       #0d9488;
    --primary-dark:  #0f766e;
    --primary-light: #ccfbf1;
    --bg:            #f1f5f9;
    --text:          #1e293b;
    --text-light:    #64748b;
    --white:         #ffffff;
    --danger:        #ef4444;
    --danger-light:  #fef2f2;
    --success:       #22c55e;
    --success-light: #dcfce7;
    --warning:       #f59e0b;
    --border:        #e2e8f0;
    --card-shadow:   0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #e0f2fe 100%);
}

.login-card {
    background: var(--white);
    padding: 44px 40px;
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

.logo-section {
    text-align: center;
    margin-bottom: 36px;
}

.logo-section h1 {
    font-size: 26px;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -.5px;
}

.logo-section p {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 6px;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
}

.form-group input,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    outline: none;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    background: var(--white);
    color: var(--text);
}

.form-group input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13,148,136,.12);
}

.input-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-pass-wrap input {
    padding-right: 44px;
}

.toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    padding: 4px;
}

.toggle-pass:hover { color: var(--primary); }

.pass-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.pass-divider::before,
.pass-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.pass-divider span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    text-decoration: none;
}

.btn:hover  { background: var(--primary-dark); }
.btn:active { transform: scale(0.98); }

.btn-sm { padding: 9px 16px; font-size: 13px; }

.btn-ghost {
    background: #f1f5f9;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover { background: var(--border); }

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
    transition: opacity .4s, transform .4s;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.error-msg {
    background: var(--danger-light);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
    background: var(--white);
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s;
    border: 1px solid var(--border);
}

.logout-btn:hover { background: #e2e8f0; }

/* ── Main Layout ────────────────────────────────────────────── */
main {
    padding: 32px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Stats Row ──────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: 18px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Card & Table ───────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
}

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 11px 16px;
    color: var(--text-light);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.badge-admin { background: #dcfce7; color: #15803d; }
.badge-user  { background: #f1f5f9; color: #475569; }

/* ── Action buttons ─────────────────────────────────────────── */
.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: .2s;
    background: var(--white);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.edit-btn:hover   { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.delete-btn       { color: var(--danger); }
.delete-btn:hover { background: var(--danger-light); border-color: #fecaca; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white);
    padding: 28px 32px 32px;
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 60px rgba(0,0,0,.2);
    animation: slideUp .25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

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

.modal-head h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: .2s;
    flex-shrink: 0;
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    main    { padding: 20px 16px; }
    header  { padding: 12px 16px; }

    .stats-row { grid-template-columns: 1fr; }

    table th:nth-child(1),
    table td:nth-child(1),
    table th:nth-child(5),
    table td:nth-child(5) { display: none; }

    .table-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
