/* ── Base ─────────────────────────────────────────────────── */
:root {
    --color-accent:  #3B82F6;
    --color-sidebar: #1E293B;
    --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

html {
    font-family: var(--font-sans);
    scroll-behavior: smooth;
}

/* Scrollbar subtil */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(156,163,175,0.4); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(156,163,175,0.7); }
.dark ::-webkit-scrollbar-thumb { background: rgba(75,85,99,0.5); }

/* Alpine x-cloak */
[x-cloak] { display: none !important; }

/* ── SVG icon fallback (daca Tailwind CDN nu se incarca) ── */
svg[viewBox="0 0 24 24"]:not([width]) { max-width: 1.25rem; max-height: 1.25rem; }
svg[width] { flex-shrink: 0; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}
.dark .card {
    background: #111827;
    border-color: #1f2937;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--color-accent);
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    text-decoration: none;
}
.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { transform: scale(0.95); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    text-decoration: none;
}
.btn-secondary:hover  { background: #e5e7eb; }
.btn-secondary:active { transform: scale(0.95); }
.dark .btn-secondary {
    color: #d1d5db;
    background: #1f2937;
    border-color: #374151;
}
.dark .btn-secondary:hover { background: #374151; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    text-decoration: none;
}
.btn-danger:hover  { background: #dc2626; }
.btn-danger:active { transform: scale(0.95); }

/* ── Input ───────────────────────────────────────────────────── */
.input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.dark .input { background: #1f2937; border-color: #4b5563; color: #fff; }
.dark .input::placeholder { color: #6b7280; }

/* ── Label ───────────────────────────────────────────────────── */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.dark .label { color: #d1d5db; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-low {
    display: inline-flex; align-items: center; gap: 0.25rem;
    border-radius: 9999px; padding: 0.125rem 0.625rem;
    font-size: 0.75rem; font-weight: 500;
    background: #f3f4f6; color: #4b5563;
}
.dark .badge-low { background: #1f2937; color: #9ca3af; }

.badge-medium {
    display: inline-flex; align-items: center; gap: 0.25rem;
    border-radius: 9999px; padding: 0.125rem 0.625rem;
    font-size: 0.75rem; font-weight: 500;
    background: #ffedd5; color: #c2410c;
}
.dark .badge-medium { background: #431407; color: #fb923c; }

.badge-critical {
    display: inline-flex; align-items: center; gap: 0.25rem;
    border-radius: 9999px; padding: 0.125rem 0.625rem;
    font-size: 0.75rem; font-weight: 500;
    background: #fee2e2; color: #b91c1c;
}
.dark .badge-critical { background: #450a0a; color: #f87171; }

/* ── Status badges ───────────────────────────────────────────── */
.status-new         { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #f3f4f6; color: #4b5563; }
.status-assigned    { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #dbeafe; color: #1d4ed8; }
.status-in_progress { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #fef9c3; color: #854d0e; }
.status-waiting     { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #f3e8ff; color: #7e22ce; }
.status-resolved    { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #d1fae5; color: #065f46; }
.status-closed      { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; background: #e5e7eb; color: #6b7280; }

.dark .status-new         { background: #1f2937; color: #9ca3af; }
.dark .status-assigned    { background: #1e3a5f; color: #93c5fd; }
.dark .status-in_progress { background: #422006; color: #fbbf24; }
.dark .status-waiting     { background: #2e1065; color: #c084fc; }
.dark .status-resolved    { background: #064e3b; color: #6ee7b7; }
.dark .status-closed      { background: #374151; color: #9ca3af; }

/* ── Table ───────────────────────────────────────────────────── */
.table-header { text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; padding: 0.75rem 1rem; }
.table-cell   { padding: 0.875rem 1rem; font-size: 0.875rem; color: #374151; }
.table-row    { border-bottom: 1px solid #f9fafb; transition: background 0.15s; }
.table-row:hover { background: rgba(249,250,251,0.5); }
.dark .table-header { color: #9ca3af; }
.dark .table-cell   { color: #d1d5db; }
.dark .table-row    { border-color: #1f2937; }
.dark .table-row:hover { background: rgba(31,41,55,0.3); }

/* ── Stat card ───────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.dark .stat-card { background: #111827; border-color: #1f2937; }

/* ── Toast notifications ─────────────────────────────────────── */
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    pointer-events: auto;
    animation: toast-in 0.25s ease-out;
}
.toast-success { background: #059669; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2563eb; }
.toast-warning { background: #d97706; }

@keyframes toast-in {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes soft-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}
.pulse-soft { animation: soft-pulse 2s ease-in-out infinite; }

/* ── Focus accent ────────────────────────────────────────────── */
.focus-accent:focus { outline: none; box-shadow: 0 0 0 2px var(--color-accent); }

/* ── Utilities ───────────────────────────────────────────────── */
.font-inter { font-family: 'Inter', sans-serif; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

/* ── Print ───────────────────────────────────────────────────── */
@media print {
    #sidebar, header { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
}
