/* ============================================================
   M-Squared IT Helpdesk - dark "glass" theme
   Design language: slate-950 canvas, translucent glass panels,
   blue/indigo brand gradient, Plus Jakarta Sans.
   Tailwind utilities handle layout; the classes below are the
   repeated chrome (fields, buttons, tables, badges).
   ============================================================ */

:root {
    --app-bg: #020617;           /* slate-950 */
    --panel: rgba(15, 23, 42, 0.75);
    --panel-card: rgba(30, 41, 59, 0.5);
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-soft: rgba(255, 255, 255, 0.05);
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
}

html, body {
    min-height: 100%;
    background-color: var(--app-bg);
}

body {
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
    color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
}

/* Ambient brand glow behind the canvas */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(60rem 30rem at 15% -10%, rgba(37, 99, 235, 0.16), transparent 60%),
        radial-gradient(50rem 28rem at 95% 0%, rgba(99, 102, 241, 0.13), transparent 60%);
}

body > * { position: relative; z-index: 1; }

/* ---------- Surfaces ---------- */
.glass-panel {
    background: var(--panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hairline);
}

.glass-card {
    background: var(--panel-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--hairline-soft);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.8);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}

/* ---------- Form controls ---------- */
.lbl {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #FFFFFF;
    margin-bottom: .375rem;
}

.field {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #1e293b;
    color: #FFFFFF;
    font-size: .8125rem;
    border-radius: .5rem;
    padding: .625rem .75rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field::placeholder { color: #FFFFFF; }

.field:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--brand-500);
}

.field:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.field-icon { padding-left: 2.25rem; }

select.field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

select.field option { background: #0f172a; color: #FFFFFF; }

textarea.field { line-height: 1.6; resize: vertical; }

input[type="file"].field { padding: .45rem .5rem; }

input[type="file"].field::file-selector-button {
    background: #1e293b;
    border: 1px solid #334155;
    color: #FFFFFF;
    font: inherit;
    font-size: .75rem;
    border-radius: .375rem;
    padding: .3rem .6rem;
    margin-right: .6rem;
    cursor: pointer;
}

/* Checkbox */
.check {
    appearance: none;
    width: 1rem;
    height: 1rem;
    flex: none;
    border: 1px solid #334155;
    border-radius: .25rem;
    background: rgba(15, 23, 42, 0.9);
    cursor: pointer;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}

.check:checked {
    background: var(--brand-600);
    border-color: var(--brand-600);
}

.check:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / .75rem no-repeat;
}

.check-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: #FFFFFF;
    cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.2;
    padding: .625rem 1rem;
    border-radius: .5rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.btn:active { transform: scale(.98); }

.btn-primary {
    background-image: linear-gradient(to right, var(--brand-600), #4f46e5);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.65);
}

.btn-primary:hover { background-image: linear-gradient(to right, var(--brand-500), #6366f1); }

.btn-ghost {
    background: rgba(30, 41, 59, 0.6);
    border-color: #334155;
    color: #FFFFFF;
}

.btn-ghost:hover { background: rgba(30, 41, 59, 0.95); color: #fff; }

.btn-outline {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--brand-400);
}

.btn-outline:hover { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }

.btn-warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.btn-warn:hover { background: rgba(245, 158, 11, 0.18); }

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.22);
    color: #fb7185;
}

.btn-danger:hover { background: rgba(244, 63, 94, 0.18); }

.btn-sm { padding: .375rem .625rem; font-size: .75rem; border-radius: .375rem; }

.btn-link {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: .8125rem;
    padding: .625rem .75rem;
    cursor: pointer;
}

.btn-link:hover { color: #fff; }

/* ---------- Tables ---------- */
.data-table {
    width: 100%;
    text-align: left;
    font-size: .8125rem;
    color: #FFFFFF;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid #1e293b;
}

.data-table thead th {
    padding: .875rem 1.25rem;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #FFFFFF;
    white-space: nowrap;
}

.data-table tbody tr { border-top: 1px solid rgba(30, 41, 59, 0.6); }

.data-table tbody tr:hover { background: rgba(15, 23, 42, 0.6); }

.data-table tbody td { padding: .875rem 1.25rem; vertical-align: middle; }

.data-table .num { font-variant-numeric: tabular-nums; }

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

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .625rem;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-slate   { background: rgba(100, 116, 139, 0.14); color: #FFFFFF; border-color: rgba(148, 163, 184, 0.22); }
.badge-blue    { background: rgba(59, 130, 246, 0.1);  color: #60a5fa; border-color: rgba(59, 130, 246, 0.22); }
.badge-indigo  { background: rgba(99, 102, 241, 0.1);  color: #818cf8; border-color: rgba(99, 102, 241, 0.22); }
.badge-violet  { background: rgba(168, 85, 247, 0.1);  color: #c084fc; border-color: rgba(168, 85, 247, 0.22); }
.badge-amber   { background: rgba(245, 158, 11, 0.1);  color: #fbbf24; border-color: rgba(245, 158, 11, 0.22); }
.badge-orange  { background: rgba(249, 115, 22, 0.1);  color: #fb923c; border-color: rgba(249, 115, 22, 0.22); }
.badge-emerald { background: rgba(16, 185, 129, 0.1);  color: #34d399; border-color: rgba(16, 185, 129, 0.22); }
.badge-rose    { background: rgba(244, 63, 94, 0.1);   color: #fb7185; border-color: rgba(244, 63, 94, 0.22); }
.badge-cyan    { background: rgba(6, 182, 212, 0.1);   color: #22d3ee; border-color: rgba(6, 182, 212, 0.22); }

.badge-lg { font-size: .75rem; padding: .35rem .8rem; }

/* ---------- Navigation ---------- */
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .875rem;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 500;
    color: #FFFFFF;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-pill:hover { color: #FFFFFF; background: rgba(30, 41, 59, 0.6); }

.nav-pill.active {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
}

/* Segmented tabs (ticket views, admin sections) */
.seg {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    border-radius: .75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #1e293b;
    flex-wrap: wrap;
}

.seg-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .875rem;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 500;
    color: #FFFFFF;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.seg-item:hover { color: #FFFFFF; background: rgba(30, 41, 59, 0.7); }

.seg-item.active {
    color: #fff;
    background-image: linear-gradient(to right, var(--brand-600), #4f46e5);
    box-shadow: 0 8px 20px -12px rgba(37, 99, 235, 0.8);
}

/* ---------- Lists ---------- */
.stack-list { list-style: none; margin: 0; padding: 0; }

.stack-list > li {
    padding: .75rem 1.25rem;
    border-top: 1px solid rgba(30, 41, 59, 0.6);
    font-size: .8125rem;
    color: #FFFFFF;
}

.stack-list > li:first-child { border-top: none; }

/* Meter used by the breakdown panels */
.meter {
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    background: #1e293b;
    overflow: hidden;
}

.meter > span { display: block; height: 100%; border-radius: 9999px; }

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem;
    border-radius: .75rem;
    font-size: .8125rem;
    border: 1px solid transparent;
}

.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.alert-error   { background: rgba(244, 63, 94, 0.1);  border-color: rgba(244, 63, 94, 0.25);  color: #fda4af; }

/* Validation summary / field errors from ASP.NET */
.text-danger, .field-validation-error, .validation-summary-errors {
    color: #fb7185 !important;
    font-size: .75rem;
}

.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

.input-validation-error { box-shadow: 0 0 0 1px #f43f5e; border-color: #f43f5e; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.6); }
::-webkit-scrollbar-thumb { background: rgba(51, 65, 85, 0.6); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(71, 85, 105, 0.8); }

/* ---------- Misc ---------- */
.prose-body { white-space: pre-wrap; line-height: 1.7; color: #FFFFFF; font-size: .875rem; }

a.link { color: var(--brand-400); text-decoration: none; font-weight: 600; }
a.link:hover { color: #93c5fd; text-decoration: underline; }

.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .625rem;
    border-radius: .75rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand-400);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[hidden] { display: none !important; }
