/* ============================================================
   app.css – Xmart101 Platform v3
   ============================================================ */

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Page fade-in */
main { animation: fadeUp 180ms ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Loading spinner */
.spinner { border: 3px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; width: 24px; height: 24px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Card hover lift */
.card-hover { transition: transform 180ms ease, box-shadow 180ms ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* ── Buttons ── */
.btn-primary {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: #2563eb; color: #fff;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: none; cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-decoration: none; white-space: nowrap;
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.3); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: transparent; color: #374151;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: 1.5px solid #e5e7eb; cursor: pointer;
    transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-danger {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.125rem;
    background: #dc2626; color: #fff;
    font-weight: 600; font-size: .875rem;
    border-radius: .5rem; border: none; cursor: pointer;
    transition: background .15s; text-decoration: none; white-space: nowrap;
}
.btn-danger:hover { background: #b91c1c; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 2rem; width: 2rem;
    border-radius: .5rem;
    background: transparent; border: none; cursor: pointer;
    transition: background .15s; text-decoration: none; color: inherit;
}
.icon-btn:hover { background: #f3f4f6; }

/* ── Form Fields ── */
.field-label { display: block; font-size: .8125rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.field-input {
    display: block; width: 100%;
    padding: .625rem .75rem;
    border: 1.5px solid #e5e7eb; border-radius: .5rem;
    font-size: .875rem; color: #111827; background: #fff;
    outline: none; transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.field-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.field-input::placeholder { color: #d1d5db; }
textarea.field-input { resize: vertical; }
select.field-input { cursor: pointer; }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center;
    font-size: .6875rem; font-weight: 600;
    padding: .2rem .6rem; border-radius: 9999px;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #ffedd5; color: #c2410c; }

/* ── Tables ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.th-cell { padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.td-cell { padding: .75rem 1rem; }

/* ── Priority pills ── */
.priority-low    { display: inline-flex; font-size: .6875rem; font-weight: 500; padding: .15rem .6rem; border-radius: 9999px; background: #f3f4f6; color: #6b7280; }
.priority-medium { display: inline-flex; font-size: .6875rem; font-weight: 500; padding: .15rem .6rem; border-radius: 9999px; background: #dbeafe; color: #1d4ed8; }
.priority-high   { display: inline-flex; font-size: .6875rem; font-weight: 600; padding: .15rem .6rem; border-radius: 9999px; background: #ffedd5; color: #c2410c; }
.priority-urgent { display: inline-flex; font-size: .6875rem; font-weight: 700; padding: .15rem .6rem; border-radius: 9999px; background: #fee2e2; color: #b91c1c; }

/* ── Line clamp ── */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Modal backdrop ── */
[data-modal-backdrop] { backdrop-filter: blur(2px); }
