/* ============================================================
   CRM Ticket Management System — Dark Theme
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ---------- Navbar ---------- */
.navbar {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    text-decoration: none;
    color: #f0f6fc;
}

.brand-icon { font-size: 26px; }

.nav-brand strong {
    font-size: 18px;
    letter-spacing: -.3px;
    color: #58a6ff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: #8b949e;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    transition: all .15s;
}

.nav-link:hover {
    background: #21262d;
    color: #f0f6fc;
}

.nav-link.logout {
    color: #f85149;
    margin-left: 8px;
}

.nav-link.logout:hover {
    background: #2d1b1b;
}

/* ---------- Flash Messages ---------- */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #0f2d1a; color: #7ee787; border: 1px solid #1a4d2e; }
.flash-info    { background: #0f2d3d; color: #79c0ff; border: 1px solid #1a4d5c; }
.flash-warning { background: #2d240f; color: #d29922; border: 1px solid #4d3d1a; }
.flash-danger  { background: #2d0f0f; color: #f85149; border: 1px solid #4d1a1a; }

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    line-height: 1;
}

.flash-close:hover { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #30363d;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    color: #c9d1d9;
    background: #21262d;
}

.btn:hover {
    background: #30363d;
    border-color: #8b949e;
}

.btn-primary   { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.btn-primary:hover   { background: #388bfd; }

.btn-success   { background: #238636; color: #fff; border-color: #238636; }
.btn-success:hover   { background: #2ea043; }

.btn-warning   { background: #9e6a03; color: #fff; border-color: #9e6a03; }
.btn-warning:hover   { background: #bb8009; }

.btn-danger    { background: #da3633; color: #fff; border-color: #da3633; }
.btn-danger:hover    { background: #f85149; }

.btn-info      { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.btn-info:hover      { background: #388bfd; }

.btn-secondary { background: #21262d; color: #c9d1d9; border-color: #30363d; }
.btn-secondary:hover { background: #30363d; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 22px;
    color: #f0f6fc;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.welcome-text {
    color: #8b949e;
    font-size: 13px;
}

/* ---------- Metric Cards ---------- */
.metrics-grid,
.secondary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: #161b22;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #30363d;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color .15s;
}

.metric-card:hover { border-color: #58a6ff; }

.metric-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.metric-icon.total      { background: #1f2937; }
.metric-icon.new        { background: #2d240f; }
.metric-icon.assigned   { background: #1a2d3d; }
.metric-icon.progress   { background: #0f2d1a; }
.metric-icon.hold       { background: #2d240f; }
.metric-icon.resolved   { background: #0f2d1a; }
.metric-icon.verified   { background: #1a2d3d; }
.metric-icon.closed     { background: #2d1a2d; }
.metric-icon.breach     { background: #2d0f0f; }
.metric-icon.risk       { background: #2d240f; }
.metric-icon.today      { background: #1f2937; }
.metric-icon.done       { background: #0f2d1a; }

.metric-info { flex: 1; min-width: 0; }
.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #f0f6fc;
    display: block;
    line-height: 1.2;
}
.metric-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.metric-card.alert    { border-left: 3px solid #f85149; }
.metric-card.warning  { border-left: 3px solid #d29922; }
.metric-card.success  { border-left: 3px solid #238636; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin: 1px;
    white-space: nowrap;
}

/* Status badges */
.badge-status     { background: #21262d; color: #8b949e; }
.badge-status-sm  { padding: 1px 6px; font-size: 10px; }

/* Priority badges */
.badge-priority       { background: #21262d; color: #8b949e; }
.badge-priority-critical { background: #da3633; color: #fff; }
.badge-priority-high     { background: #9e6a03; color: #fff; }
.badge-priority-medium   { background: #bb8009; color: #fff; }
.badge-priority-low      { background: #238636; color: #fff; }

/* Type badges */
.badge-type { background: #2d333b; color: #c9d1d9; }

/* Module badges */
.badge-module              { background: #2d333b; color: #c9d1d9; }
.badge-module-oms          { background: #1f6feb; color: #fff; }
.badge-module-ams          { background: #8957e5; color: #fff; }
.badge-module-rms          { background: #2ea043; color: #fff; }
.badge-module-gateway      { background: #d29922; color: #fff; }
.badge-module-network      { background: #6e7681; color: #fff; }
.badge-module-power        { background: #f0e6d2; color: #c9d1d9; }
.badge-module-featuredevice { background: #f85149; color: #fff; }
.badge-module-sensor       { background: #00b894; color: #fff; }
.badge-module-valve        { background: #88d9e8; color: #0f1117; }
.badge-module-pump         { background: #f85149; color: #fff; }
.badge-module-other        { background: #484f58; color: #c9d1d9; }

/* Alert badges */
.badge-breach  { background: #da3633; color: #fff; }
.badge-risk    { background: #d29922; color: #fff; }
.badge-ok      { background: #238636; color: #fff; }

/* Role / escalation / evidence */
.badge-role        { background: #2d333b; color: #c9d1d9; }
.badge-escalation  { background: #d29922; color: #fff; }
.badge-evidence    { background: #1f6feb; color: #fff; }

/* ---------- Data Tables ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #30363d;
}

.data-table th {
    background: #21262d;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: .3px;
    border-bottom: 1px solid #30363d;
    font-weight: 600;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #21262d;
    font-size: 13px;
    vertical-align: middle;
}

.data-table tbody tr:hover { background: #1c2128; }
.data-table tbody tr:last-child td { border-bottom: none; }

.ticket-link {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 600;
    font-family: "Courier New", monospace;
    font-size: 13px;
}

.ticket-link:hover { text-decoration: underline; }

.ticket-subject-link {
    color: #e1e4e8;
    text-decoration: none;
    font-weight: 500;
}

.ticket-subject-link:hover { color: #58a6ff; }

.text-muted   { color: #6e7681; }
.text-danger  { color: #f85149; font-weight: 600; }
.text-warning { color: #d29922; font-weight: 600; }

.due-date { font-family: "Courier New", monospace; font-size: 12px; }
.due-cell.text-danger { font-weight: 700; }

.eta-cell { display: inline-flex; }
.eta-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
}

.eta-new        { background: #21262d; color: #8b949e; }
.eta-triaged    { background: #1a2d3d; color: #79c0ff; }
.eta-assigned   { background: #1f2937; color: #e1e4e8; }
.eta-accepted   { background: #0f2d1a; color: #7ee787; }
.eta-progress   { background: #2d240f; color: #d29922; }
.eta-hold       { background: #2d1a1a; color: #f85149; }
.eta-material   { background: #2d241a; color: #bb8009; }
.eta-approval   { background: #1a2d3d; color: #79c0ff; }
.eta-resolved   { background: #0f2d1a; color: #7ee787; }
.eta-verified   { background: #1a2d3d; color: #79c0ff; }
.eta-closed     { background: #21262d; color: #8b949e; }

.action-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #21262d;
    border-radius: 4px;
    font-size: 12px;
    color: #8b949e;
}

.remarks-cell {
    max-width: 280px;
    color: #8b949e;
    line-height: 1.4;
    word-break: break-word;
}

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

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #30363d;
    border-radius: 5px;
    font-size: 14px;
    color: #e1e4e8;
    background: #0d1117;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #c9d1d9;
    font-size: 13px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.required { color: #f85149; margin-left: 2px; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* ---------- Login Page ---------- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px - 60px);
    padding: 20px;
}

/* Two-column layout: benefits left + login right */
.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: calc(100vh - 60px - 60px);
    gap: 0;
    align-items: stretch;
}

.login-benefits {
    flex: 1;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #21262d;
    overflow-y: auto;
}

.benefits-brand {
    margin-bottom: 28px;
}

.brand-icon-big {
    font-size: 48px;
    margin-bottom: 4px;
}

.benefits-brand h1 {
    font-size: 28px;
    color: #58a6ff;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.brand-sub {
    color: #e1e4e8;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
}

.brand-tagline {
    color: #8b949e;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.benefits-section h3 {
    font-size: 13px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1;
}

.benefit-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 12px 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: border-color 0.15s, transform 0.15s;
}

.benefit-card:hover {
    border-color: #1f6feb;
    transform: translateY(-1px);
}

.benefit-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.benefit-card strong {
    display: block;
    color: #e1e4e8;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
}

.benefit-card p {
    font-size: 11.5px;
    color: #8b949e;
    line-height: 1.45;
    margin: 0;
}

.benefits-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #21262d;
}

.benefits-footer p {
    font-size: 11px;
    color: #6e7681;
    margin-bottom: 3px;
}

.benefits-footer a {
    color: #58a6ff;
    text-decoration: none;
}

/* Login card — right side */
.login-card-wide {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
}

.login-card-inner {
    background: #161b22;
    border-radius: 12px;
    padding: 32px 28px;
    width: 100%;
    border: 1px solid #30363d;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.login-card-inner h2 {
    font-size: 20px;
    color: #f0f6fc;
    margin-bottom: 4px;
}

.login-sub {
    color: #8b949e;
    font-size: 13px;
    margin-bottom: 20px;
}

.login-form {
    margin-bottom: 20px;
}

.login-form .form-group {
    margin-bottom: 14px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #c9d1d9;
    font-size: 12px;
}

.login-form .form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #30363d;
    border-radius: 5px;
    font-size: 14px;
    color: #e1e4e8;
    background: #0d1117;
    transition: border-color .15s, box-shadow .15s;
}

.login-form .form-control:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* Compact demo accounts */
.demo-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 12px;
    font-size: 11px;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-divider::before,
.demo-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #21262d;
}

.demo-divider span {
    padding: 0 10px;
}

.demo-accounts-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.demo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11.5px;
    transition: background 0.1s;
}

.demo-row:hover {
    background: #1c2128;
}

.demo-role {
    color: #8b949e;
    font-weight: 500;
    flex: 1;
}

.demo-creds {
    color: #58a6ff;
    font-family: "Courier New", monospace;
    font-size: 11px;
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #21262d;
}

/* ---------- Error Page ---------- */

/* ---------- Error Page ---------- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 20px;
}

.error-code {
    font-size: 90px;
    font-weight: 800;
    color: #f85149;
    margin-bottom: 8px;
    line-height: 1;
}

/* ---------- Sections ---------- */
.section {
    background: #161b22;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #30363d;
    margin-bottom: 20px;
}

.section h3 {
    font-size: 15px;
    color: #f0f6fc;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #21262d;
}

/* ---------- Ticket Detail ---------- */
.ticket-header-card {
    background: #161b22;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #30363d;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-header-left {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.ticket-header-right {
    display: flex;
    gap: 20px;
    color: #8b949e;
    font-size: 13px;
    flex-wrap: wrap;
}

.ticket-header-right .meta-item {
    display: flex;
    flex-direction: column;
}

.ticket-header-right .meta-item small {
    font-size: 10px;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.ticket-header-right .meta-item strong {
    font-size: 13px;
    color: #e1e4e8;
}

.meta-danger  { color: #f85149 !important; }
.meta-warning { color: #d29922 !important; }

.description-box {
    background: #21262d;
    border-left: 3px solid #1f6feb;
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
    margin: 10px 0;
    color: #c9d1d9;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.6;
}

.ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ticket-meta-grid .meta-item {
    background: #21262d;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.ticket-meta-grid .meta-item small {
    color: #6e7681;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.ticket-meta-grid .meta-item strong {
    display: block;
    color: #e1e4e8;
    font-size: 13px;
    margin-top: 2px;
}

/* ---------- Evidence ---------- */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.evidence-card {
    background: #161b22;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #30363d;
}

.evidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.evidence-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    background: #21262d;
}

.evidence-doc {
    background: #21262d;
    padding: 40px 16px;
    text-align: center;
    border-radius: 4px;
    font-size: 13px;
    color: #8b949e;
}

.doc-icon { font-size: 36px; display: block; margin-bottom: 6px; }

/* ---------- Evidence Upload Form ---------- */
.evidence-upload-form .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.evidence-upload-form .form-group { flex: 1; min-width: 200px; }

/* ---------- Quick Actions ---------- */
.quick-actions .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-actions .form-group { flex: 1; min-width: 200px; }

/* ---------- Worklog Table ---------- */
.worklog-table td { font-size: 12.5px; }
.worklog-table td.remarks-cell { max-width: 320px; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.page-info {
    font-size: 13px;
    color: #8b949e;
    padding: 0 8px;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-form {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form select,
.filter-form input[type="text"] {
    padding: 5px 10px;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 13px;
    background: #0d1117;
    color: #e1e4e8;
}

.filter-form input[type="text"] {
    width: 160px;
}

/* ---------- Search Form ---------- */
.search-form { margin-bottom: 12px; }
.search-form input[type="text"] { width: 280px; }

/* ---------- Dashboard extras ---------- */
.dashboard .secondary-metrics { margin-bottom: 20px; }

/* Priority bars */
.priority-bars { margin-top: 6px; }
.priority-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.priority-label {
    width: 75px;
    font-size: 12px;
    font-weight: 500;
    color: #8b949e;
    text-align: right;
}

.priority-bar-bg {
    flex: 1;
    height: 18px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}

.priority-bar {
    height: 100%;
    border-radius: 4px;
    transition: width .3s ease;
    min-width: 2px;
}

.priority-bar.priority-critical { background: #f85149; }
.priority-bar.priority-high     { background: #d29922; }
.priority-bar.priority-medium   { background: #bb8009; }
.priority-bar.priority-low      { background: #238636; }

/* ---------- Reports ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.kpi-card {
    background: #161b22;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #30363d;
}

.kpi-card.success { border-left: 3px solid #238636; }

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #f0f6fc;
    display: block;
    line-height: 1.2;
}

.kpi-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 2px;
}

.status-bars { margin-top: 6px; }

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.status-label {
    width: 120px;
    font-size: 12px;
    color: #8b949e;
    text-align: right;
}

.status-bar-bg {
    flex: 1;
    height: 14px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}

.status-bar {
    height: 100%;
    background: #58a6ff;
    border-radius: 4px;
    transition: width .3s;
    min-width: 2px;
}

.count-bar-bg {
    flex: 1;
    height: 14px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}

.count-bar {
    height: 100%;
    background: #238636;
    border-radius: 4px;
    transition: width .3s;
    min-width: 2px;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 14px 20px;
    color: #6e7681;
    font-size: 11px;
    border-top: 1px solid #21262d;
    margin-top: auto;
    background: #0d1117;
}

/* ---------- Member list ---------- */
.member-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: #8b949e;
}

.member-list li {
    padding: 2px 0;
}

/* ---------- Examples section ---------- */
.examples-section {
    margin-top: 24px;
}

.examples-section h3 {
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 10px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.example-card {
    background: #21262d;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 12px;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

.example-card strong {
    display: block;
    color: #e1e4e8;
    margin-bottom: 4px;
    font-size: 13px;
}

.example-card ul {
    margin: 0;
    padding-left: 18px;
}

.example-card li { margin-bottom: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .navbar { padding: 10px 14px; }
    .nav-links { gap: 0; }
    .nav-link { padding: 5px 8px; font-size: 12px; }
    .container { padding: 14px; }

    .metrics-grid,
    .secondary-metrics {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .metric-value { font-size: 20px; }
    .metric-icon  { width: 36px; height: 36px; font-size: 22px; }

    .page-header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; }

    .ticket-header-card { flex-direction: column; }
    .ticket-header-right { gap: 12px; }

    .ticket-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .evidence-grid {
        grid-template-columns: 1fr;
    }

    .form-row { flex-direction: column; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form select,
    .filter-form input[type="text"] { width: 100%; }

    .demo-table { font-size: 11px; }
    .demo-table th, .demo-table td { padding: 3px 6px; }

    /* Login page responsive */
    .login-wrapper {
        flex-direction: column;
    }

    .login-benefits {
        border-right: none;
        border-bottom: 1px solid #21262d;
        padding: 20px 18px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .login-card-wide {
        width: 100%;
        padding: 10px 0;
    }

    .login-card-inner {
        padding: 24px 20px;
    }

    .benefit-card strong {
        font-size: 12px;
    }

    .benefit-card p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .login-card { padding: 24px 20px; }
    .login-card h1 { font-size: 19px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 7px 8px; }
    .ticket-header-right { flex-direction: column; gap: 4px; }
    .priority-label { width: 60px; font-size: 11px; }

    .benefits-brand h1 {
        font-size: 22px;
    }

    .brand-icon-big {
        font-size: 36px;
    }

    .login-card-inner h2 {
        font-size: 18px;
    }
}
