/* =========================================================================
   Simple Bug Tracker — custom theme on top of Bootstrap 5
   ========================================================================= */

:root {
    --bt-primary: #4f46e5;        /* indigo */
    --bt-primary-dark: #4338ca;
    --bt-sidebar-bg: #1e293b;     /* slate-800 */
    --bt-sidebar-hover: #334155;
    --bt-sidebar-active: #4f46e5;
    --bt-body-bg: #f1f5f9;        /* slate-100 */
    --bt-card-radius: 16px;
    --bt-shadow: 0 4px 20px rgba(15, 23, 42, .06);
    --bt-shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --bt-sidebar-width: 250px;
}

* { box-sizing: border-box; }

body {
    background: var(--bt-body-bg);
    color: #1e293b;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Make Bootstrap primary match our theme */
.btn-primary {
    --bs-btn-bg: var(--bt-primary);
    --bs-btn-border-color: var(--bt-primary);
    --bs-btn-hover-bg: var(--bt-primary-dark);
    --bs-btn-hover-border-color: var(--bt-primary-dark);
    --bs-btn-active-bg: var(--bt-primary-dark);
}
a { color: var(--bt-primary); }

/* -------------------------------------------------------------------------
   Auth screens
   ------------------------------------------------------------------------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
    padding: 1.5rem;
}
.auth-wrapper { width: 100%; max-width: 430px; }
.auth-card {
    background: #fff;
    border-radius: var(--bt-card-radius);
    padding: 2.25rem;
}
.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border-radius: 18px;
    font-size: 1.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--bt-primary), #7c3aed);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .4);
}
.auth-logo.sm { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 11px; }

/* Password strength meter */
.password-meter-bar {
    height: 6px; border-radius: 4px; background: #e2e8f0; overflow: hidden;
}
.password-meter-bar span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* -------------------------------------------------------------------------
   App shell: sidebar + main
   ------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--bt-sidebar-width);
    background: var(--bt-sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.15rem 1.25rem;
    font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: 1rem .75rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .9rem; border-radius: 10px;
    color: #cbd5e1; text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.1rem; }
.sidebar-link:hover { background: var(--bt-sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--bt-sidebar-active); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.4); }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }

.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    z-index: 1035; display: none;
}
.sidebar-backdrop.show { display: block; }

.main-col {
    flex: 1;
    margin-left: var(--bt-sidebar-width);
    display: flex; flex-direction: column; min-width: 0;
}

/* Topbar */
.topbar {
    display: flex; align-items: center; gap: .75rem;
    background: #fff; padding: .75rem 1.5rem;
    box-shadow: var(--bt-shadow);
    position: sticky; top: 0; z-index: 1020;
}
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bt-primary); color: #fff; font-weight: 600; font-size: .85rem;
}

.breadcrumb-bar { padding: .65rem 1.5rem; }
.breadcrumb-bar .breadcrumb { font-size: .85rem; }

.content-area { padding: 0 1.5rem 1.5rem; flex: 1; }

.app-footer {
    padding: 1rem 1.5rem; text-align: center;
    color: #94a3b8; font-size: .825rem;
    border-top: 1px solid #e2e8f0;
}

/* -------------------------------------------------------------------------
   Cards & components
   ------------------------------------------------------------------------- */
.content-card {
    border: none; border-radius: var(--bt-card-radius);
    box-shadow: var(--bt-shadow);
}
.content-card .card-header {
    background: #fff; border-bottom: 1px solid #eef2f7;
    font-weight: 600; border-radius: var(--bt-card-radius) var(--bt-card-radius) 0 0;
}

/* Stat cards */
.stat-card {
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border-radius: var(--bt-card-radius);
    padding: 1.1rem 1.25rem; box-shadow: var(--bt-shadow);
    height: 100%;
}
.stat-icon {
    width: 50px; height: 50px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 13px; font-size: 1.4rem; color: #fff;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { color: #64748b; font-size: .82rem; margin-top: .25rem; }
.stat-primary .stat-icon { background: linear-gradient(135deg,#4f46e5,#6366f1); }
.stat-info    .stat-icon { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }
.stat-warning .stat-icon { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.stat-success .stat-icon { background: linear-gradient(135deg,#10b981,#34d399); }
.stat-danger  .stat-icon { background: linear-gradient(135deg,#ef4444,#f87171); }
.stat-dark    .stat-icon { background: linear-gradient(135deg,#334155,#475569); }

/* Tables */
.table > thead th {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
    color: #64748b; font-weight: 600; border-bottom-width: 1px;
}
.table > tbody td { border-color: #f1f5f9; }
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--bt-primary); }
.sort-link.active { color: var(--bt-primary); }
.sort-link i { font-size: .75rem; opacity: .6; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* Detail view */
.detail-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin-bottom: .25rem; }
.description-box { white-space: pre-wrap; line-height: 1.6; background: #f8fafc; border-radius: 12px; padding: 1rem; }
.screenshot-preview { max-height: 480px; cursor: zoom-in; }

textarea.auto-expand { overflow: hidden; resize: none; }

/* Badges spacing in inline action forms */
td form.d-inline { margin: 0; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-col { margin-left: 0; }
}
