/* ==========================================
   SUPPORT DESK DASHBOARD DESIGN SYSTEM
   ========================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151d30 0%, #0b0f19 100%);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0b0f19;

  --glass-bg: rgba(17, 24, 39, 0.65);
  --glass-bg-inset: rgba(17, 24, 39, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --glass-shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.5);

  --color-green: 142, 70%, 50%;
  --color-blue: 217, 91%, 60%;
  --color-purple: 271, 91%, 65%;
  --color-orange: 27, 90%, 55%;
  --color-red: 350, 89%, 60%;
  --color-neutral: 215, 15%, 65%;
}

[data-theme="light"] {
  --bg-app: #f4f6fa;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f4f6fa 100%);

  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-inset: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.5);
  --glass-shadow: rgba(31, 41, 55, 0.08);
  --glass-shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.05);

  --color-green: 142, 76%, 36%;
  --color-blue: 217, 91%, 50%;
  --color-purple: 271, 80%, 50%;
  --color-orange: 27, 90%, 45%;
  --color-red: 350, 80%, 50%;
  --color-neutral: 215, 15%, 45%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background var(--transition-slow), color var(--transition-fast);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.glow-accent { position: absolute; border-radius: var(--radius-full); filter: blur(140px); opacity: 0.45; z-index: 0; pointer-events: none; transition: opacity var(--transition-slow); }
.glow-1 { top: -150px; left: 20%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, transparent 70%); }
.glow-2 { bottom: 10%; right: 15%; width: 450px; height: 450px; background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%); }
[data-theme="light"] .glow-accent { opacity: 0.15; }

.app-container { max-width: 1440px; margin: 0 auto; padding: 40px 24px; position: relative; z-index: 10; }

.bg-glass { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); box-shadow: 0 10px 30px -10px var(--glass-shadow); transition: border var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-slow); }
.bg-glass-inset { background: var(--glass-bg-inset); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow-inset); }

.hidden { display: none !important; }

/* Header */
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.header-left .logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 32px; height: 32px; color: hsl(var(--color-blue)); }
.header-left h1 { font-family: var(--font-heading); font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.header-left h1 span { background: linear-gradient(135deg, hsl(var(--color-blue)) 0%, hsl(var(--color-purple)) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-left .subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 16px; }

.view-tabs { display: flex; background: var(--glass-bg-inset); padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--glass-border); gap: 4px; }
.view-tab { background: transparent; border: none; color: var(--text-muted); padding: 10px 20px; border-radius: 10px; font-family: var(--font-heading); font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.view-tab:hover { color: var(--text-main); }
.view-tab.active { background: var(--glass-bg); color: var(--text-main); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--glass-border-focus); }

.status-indicator { display: flex; align-items: center; gap: 8px; background: var(--glass-bg-inset); padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); font-size: 13px; font-weight: 500; }
.pulse-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background-color: hsl(var(--color-green)); box-shadow: 0 0 8px hsl(var(--color-green)); animation: pulse 1.8s infinite; }
.pulse-dot.error { background-color: hsl(var(--color-red)); box-shadow: 0 0 8px hsl(var(--color-red)); }
@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px currentColor; } 100% { transform: scale(0.95); opacity: 0.5; } }

.theme-toggle-btn, .nav-arrow-btn { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 10px; border-radius: var(--radius-md); color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform var(--transition-fast), border var(--transition-normal); }
.theme-toggle-btn:hover, .nav-arrow-btn:hover { transform: translateY(-2px) rotate(0deg); border-color: var(--glass-border-focus); }
.nav-arrow-btn:active svg { transform: rotate(180deg); }
.theme-toggle-btn svg, .nav-arrow-btn svg { width: 20px; height: 20px; transition: transform var(--transition-slow); }
[data-theme="dark"] .theme-toggle-btn .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle-btn .moon-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .sun-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .moon-icon { display: block; }

/* Filters */
.filter-controls { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 280px; }
.search-box input { width: 100%; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-main); padding: 12px 16px 12px 46px; border-radius: var(--radius-md); font-family: var(--font-body); font-size: 14px; outline: none; transition: all var(--transition-normal); }
.search-box input:focus { border-color: var(--glass-border-focus); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); background: var(--glass-bg-inset); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }

.filters-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.filter-pills { display: flex; background: var(--glass-bg-inset); padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--glass-border); gap: 4px; flex-wrap: wrap; }
.filter-pill { background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 550; cursor: pointer; transition: all var(--transition-fast); }
.filter-pill:hover { color: var(--text-main); }
.filter-pill.active { background: var(--glass-bg); color: var(--text-main); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }

.sort-dropdown { display: flex; align-items: center; gap: 8px; background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 8px 14px; border-radius: var(--radius-md); }
.sort-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.sort-dropdown select { background: transparent; border: none; color: var(--text-main); font-size: 13px; font-weight: 600; outline: none; cursor: pointer; font-family: var(--font-body); }
.sort-dropdown select option { background: var(--bg-app); color: var(--text-main); }

/* Metrics */
.metrics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 24px; }
.metric-card { border-radius: var(--radius-lg); padding: 24px; display: flex; align-items: center; gap: 20px; }
.metric-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.metric-icon.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.metric-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.metric-icon svg { width: 24px; height: 24px; }
.metric-info h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.metric-value { font-family: var(--font-heading); font-size: 28px; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.metric-trend { font-size: 12px; margin-top: 4px; display: block; font-weight: 500; }
.text-green { color: #10b981; } .text-red { color: #ef4444; } .text-blue { color: #3b82f6; } .text-orange { color: #f59e0b; }

/* Bucket breakdown strip */
.bucket-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.bucket-chip { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-full); background: var(--glass-bg-inset); border: 1px solid var(--glass-border); font-size: 13px; font-weight: 600; color: var(--text-main); cursor: pointer; transition: all var(--transition-fast); }
.bucket-chip:hover { border-color: var(--glass-border-focus); transform: translateY(-1px); }
.bucket-chip.active { background: var(--glass-bg); box-shadow: 0 0 0 1px var(--glass-border-focus); }
.bucket-chip .dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }
.bucket-chip .count { font-family: var(--font-heading); font-weight: 800; }
.dot.blue, .text-dot-blue { background: hsl(var(--color-blue)); }
.dot.green { background: hsl(var(--color-green)); }
.dot.purple { background: hsl(var(--color-purple)); }
.dot.orange { background: hsl(var(--color-orange)); }
.dot.red { background: hsl(var(--color-red)); }
.dot.neutral { background: hsl(var(--color-neutral)); }

/* Overview layout (three columns of ticket lists) */
.overview-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-bottom: 24px; }
.overview-col { border-radius: var(--radius-lg); padding: 20px; max-height: 480px; display: flex; flex-direction: column; }
.overview-col h3 { font-family: var(--font-heading); font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 4px; }
.ticket-list:empty::after { content: 'No tickets here.'; color: var(--text-muted); font-size: 13px; padding: 16px 0; display: block; }

.ticket-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--glass-bg-inset); border: 1px solid var(--glass-border); cursor: pointer; transition: all var(--transition-fast); text-decoration: none; color: inherit; }
.ticket-row:hover { border-color: var(--glass-border-focus); transform: translateX(2px); }
.ticket-row .priority-dot { width: 9px; height: 9px; border-radius: var(--radius-full); flex: 0 0 9px; }
.ticket-row .ticket-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
.ticket-row .ticket-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ticket-row .ticket-line-primary { justify-content: space-between; }
.ticket-row .ticket-line-secondary { justify-content: space-between; }
.ticket-row .ticket-key-group { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.ticket-row .ticket-key { overflow: hidden; color: hsl(var(--color-blue)); font-family: var(--font-heading); font-size: 12px; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row .ticket-badge-group { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.ticket-row .ticket-summary { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-main); font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row .ticket-meta { flex: 0 1 auto; min-width: 0; max-width: 52%; overflow: hidden; color: var(--text-muted); font-size: 11px; line-height: 1.3; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row .ticket-status-badge { flex: 0 0 auto; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap; }
.ticket-row .stale-tag,
.ticket-row .over-tag { flex: 0 0 auto; margin-left: 0; }

.priority-dot.red, .card-badge.priority-red { background: #ef4444; }
.priority-dot.orange, .card-badge.priority-orange { background: #f59e0b; }
.priority-dot.blue, .card-badge.priority-blue { background: #3b82f6; }
.priority-dot.green, .card-badge.priority-green { background: #10b981; }
.priority-dot.neutral, .card-badge.priority-neutral { background: #9ca3af; }

.status-badge.blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-badge.green { background: rgba(16,185,129,0.15); color: #10b981; }
.status-badge.purple { background: rgba(168,85,247,0.15); color: #a855f7; }
.status-badge.orange { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-badge.red { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-badge.neutral { background: rgba(156,163,175,0.15); color: #9ca3af; }

/* Stale ticket highlighting */
.ticket-row.stale { border-left: 3px solid #ef4444; }
.stale-tag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #ef4444; background: rgba(239,68,68,0.12); padding: 2px 6px; border-radius: var(--radius-sm); margin-left: 6px; vertical-align: middle; }
tr.stale-row td:first-child { box-shadow: inset 3px 0 0 #ef4444; }

/* SLA badges */
.sla-badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; flex-shrink: 0; }
.sla-badge.breached { background: rgba(239,68,68,0.18); color: #ef4444; animation: sla-pulse 2s infinite; }
.sla-badge.at-risk { background: rgba(245,158,11,0.18); color: #f59e0b; }
@keyframes sla-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Agent card breach accent */
.agent-card.has-breach { border-color: rgba(239, 68, 68, 0.35); }
.agent-card.has-breach:hover { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 15px 35px -10px rgba(239, 68, 68, 0.2); }

/* Dev Queue: New Task alert (red) */
tr.dev-alert-row td { background: rgba(239, 68, 68, 0.06); }

/* Over-retainer highlighting (client has exceeded monthly retainer hours) */
.ticket-row.over-retainer { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); }
tr.over-retainer-row td { background: rgba(239, 68, 68, 0.06); }
.over-tag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: #ef4444; padding: 2px 6px; border-radius: var(--radius-sm); margin-left: 6px; vertical-align: middle; white-space: nowrap; }

/* Linked WHD ticket chips (Dev Queue) */
.whd-chip { display: inline-block; font-family: var(--font-heading); font-size: 11px; font-weight: 700; color: hsl(var(--color-blue)); background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.25); padding: 2px 8px; border-radius: var(--radius-full); text-decoration: none; margin: 1px 0; transition: all var(--transition-fast); }
.whd-chip:hover { background: rgba(59, 130, 246, 0.25); }

/* Dev queue assignee group rows */
.dev-view-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.dev-view-header h3 { font-family: var(--font-heading); font-size: 15px; font-weight: 700; }
tr.dev-group-row td { background: var(--glass-bg-inset); font-family: var(--font-heading); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 8px 16px; }

/* Agent grid */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; min-height: 200px; }

.loading-state, .error-state, .empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--glass-border); border-top-color: hsl(var(--color-blue)); border-radius: var(--radius-full); animation: spin 1s infinite linear; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state svg, .empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; }
.error-state h3, .empty-state h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.error-state p, .empty-state p { color: var(--text-muted); max-width: 400px; font-size: 14px; }

.agent-card { border-radius: var(--radius-lg); padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 18px; transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal); position: relative; overflow: hidden; }
.agent-card:hover { transform: translateY(-4px) scale(1.01); border-color: var(--glass-border-focus); box-shadow: 0 15px 35px -10px rgba(99, 102, 241, 0.15); }

.agent-card-header { display: flex; align-items: center; gap: 14px; }
.agent-avatar { width: 48px; height: 48px; border-radius: var(--radius-full); background: linear-gradient(135deg, hsl(var(--color-blue)) 0%, hsl(var(--color-purple)) 100%); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: #fff; flex-shrink: 0; background-size: cover; background-position: center; }
.agent-avatar-lg { width: 64px; height: 64px; border-radius: var(--radius-full); background: linear-gradient(135deg, hsl(var(--color-blue)) 0%, hsl(var(--color-purple)) 100%); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: #fff; flex-shrink: 0; background-size: cover; background-position: center; }
.agent-name { font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.agent-total { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.agent-bucket-row { display: flex; flex-direction: column; gap: 8px; }
.agent-bucket-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--glass-bg-inset); border: 1px solid var(--glass-border); font-size: 12.5px; }
.agent-bucket-item .agent-bucket-label { display: flex; align-items: center; gap: 8px; color: var(--text-main); font-weight: 500; }
.agent-bucket-item .agent-bucket-count { font-family: var(--font-heading); font-weight: 800; font-size: 14px; }

/* Agent modal */
.agent-modal-identity { display: flex; align-items: center; gap: 16px; }
.agent-bucket-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.agent-bucket-tab { background: var(--glass-bg-inset); border: 1px solid var(--glass-border); color: var(--text-muted); padding: 8px 14px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.agent-bucket-tab:hover { color: var(--text-main); }
.agent-bucket-tab.active { background: var(--glass-bg); color: var(--text-main); box-shadow: 0 0 0 1px var(--glass-border-focus); }

/* Modal (shared) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-content { max-width: 780px; width: 100%; max-height: 88vh; overflow-y: auto; border-radius: var(--radius-lg); padding: 32px; position: relative; }
.modal-close { position: absolute; top: 20px; right: 20px; background: var(--glass-bg-inset); border: 1px solid var(--glass-border); border-radius: var(--radius-full); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); }
.modal-close svg { width: 16px; height: 16px; }
.modal-header-section { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.modal-header-section h2 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.modal-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.meta-tag { font-size: 12px; background: var(--glass-bg-inset); border: 1px solid var(--glass-border); padding: 4px 10px; border-radius: var(--radius-full); color: var(--text-muted); font-weight: 500; }

.modal-table-section { border-radius: var(--radius-md); padding: 16px; }
.table-scroll { overflow-x: auto; max-height: 400px; overflow-y: auto; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); }
.breakdown-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.breakdown-table th { background: var(--glass-bg-inset); padding: 12px 16px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; z-index: 1; font-family: var(--font-heading); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.breakdown-table td { padding: 10px 16px; border-bottom: 1px solid var(--glass-border); color: var(--text-main); }
.breakdown-table tbody tr:last-child td { border-bottom: none; }
.breakdown-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.breakdown-table a { color: hsl(var(--color-blue)); text-decoration: none; font-family: var(--font-heading); font-weight: 700; font-size: 12px; }

.all-tickets-view { border-radius: var(--radius-lg); padding: 20px; }

/* Error / config screen */
.fallback-upload-container { position: fixed; inset: 0; background: var(--bg-gradient); background-color: var(--bg-app); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.upload-card { width: 100%; max-width: 480px; border-radius: var(--radius-lg); padding: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; border-color: rgba(239, 68, 68, 0.25); }
.upload-icon-wrapper { width: 72px; height: 72px; border-radius: var(--radius-full); background: rgba(239, 68, 68, 0.12); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: #ef4444; }
.upload-icon { width: 32px; height: 32px; }
.upload-card h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.upload-desc { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 28px; }
.custom-file-upload { background: linear-gradient(135deg, hsl(var(--color-blue)) 0%, hsl(var(--color-purple)) 100%); color: var(--text-inverse); padding: 12px 28px; font-weight: 600; font-size: 14px; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35); display: inline-block; font-family: var(--font-heading); }
.custom-file-upload:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--glass-border-focus); }

/* Responsive */
@media (max-width: 900px) {
  .app-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .header-right { width: 100%; justify-content: space-between; }
}
@media (max-width: 550px) {
  .app-container { padding: 24px 16px; }
  .filter-controls { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 100%; }
  .filters-group { flex-direction: column; align-items: stretch; }
  .filter-pills { justify-content: space-between; }
  .filter-pill { flex: 1; padding: 6px 10px; font-size: 12px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 22px; }
}

/* ==========================================
   SMAP WEEKLY PLANNING / DEV QUEUE OVERRIDES
   ========================================== */
.ticket-key-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: max-content;
  white-space: nowrap;
}

.ticket-key-line .over-tag,
.ticket-key-line .dev-alert-tag {
  flex: 0 0 auto;
  margin: 0;
}

/* Keep the ticket key and its labels together in tabular views. */
.breakdown-table td:first-child {
  min-width: 220px;
  white-space: nowrap;
}

.over-tag,
.dev-alert-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  background: #ef4444;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* New Task is an invalid resting status and must be obvious. */
tr.dev-alert-row td {
  background: rgba(239, 68, 68, 0.14);
  border-top-color: rgba(239, 68, 68, 0.30);
  border-bottom-color: rgba(239, 68, 68, 0.30);
}
tr.dev-alert-row td:first-child {
  box-shadow: inset 4px 0 0 #ef4444;
}
tr.dev-alert-row:hover td {
  background: rgba(239, 68, 68, 0.20);
}
tr.dev-alert-row .ticket-key-line > a {
  color: #ef4444;
}

.ticket-row.dev-alert {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  border-left: 4px solid #ef4444;
}
.ticket-row.dev-alert:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.65);
}
.ticket-row.dev-alert .ticket-key {
  color: #ef4444;
}

/* ==========================================
   THREE-WEEK SMAP PLANNING SECTION
   ========================================== */
.overview-view {
  display: block;
  min-width: 0;
}

.overview-view > .overview-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.planning-section {
  margin-top: 24px;
  min-width: 0;
}

.planning-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.planning-eyebrow,
.planning-week-kicker {
  display: block;
  color: hsl(var(--color-blue));
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.planning-section-header h2 {
  margin-top: 2px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.planning-section-header p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.planning-weeks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.planning-week-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 260px;
  max-height: 620px;
  padding: 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.planning-week-card:first-child {
  border-color: rgba(59, 130, 246, 0.38);
  box-shadow: 0 10px 30px -10px var(--glass-shadow), 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.planning-week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--glass-border);
  flex: 0 0 auto;
}

.planning-week-header h3 {
  margin-top: 2px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.planning-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.13);
  border: 1px solid rgba(59, 130, 246, 0.24);
  color: hsl(var(--color-blue));
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
}

.planning-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 3px 2px 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.planning-ticket {
  display: block;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-inset);
  color: inherit;
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.planning-ticket:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-focus);
  background: var(--glass-bg);
}

.planning-ticket-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.planning-ticket-top .priority-dot {
  flex: 0 0 auto;
}

.planning-ticket-key-group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: max-content;
  white-space: nowrap;
}

.planning-ticket-key-group .over-tag,
.planning-ticket-key-group .dev-alert-tag {
  flex: 0 0 auto;
  margin: 0;
}

.planning-ticket-key {
  color: hsl(var(--color-blue));
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.planning-ticket-top .ticket-status-badge {
  margin-left: auto;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-ticket-top .over-tag,
.planning-ticket-top .dev-alert-tag {
  margin-left: 0;
}

.planning-ticket-summary {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.planning-ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 11px;
}

.planning-ticket-meta span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-ticket-meta span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.planning-ticket.dev-alert {
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.42);
  box-shadow: inset 4px 0 0 #ef4444;
}

.planning-ticket.dev-alert:hover {
  background: rgba(239, 68, 68, 0.19);
  border-color: rgba(239, 68, 68, 0.62);
}

.planning-ticket.dev-alert .planning-ticket-key {
  color: #ef4444;
}

.planning-ticket.over-retainer:not(.dev-alert) {
  border-color: rgba(239, 68, 68, 0.32);
}

.planning-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1100px) {
  .overview-view > .overview-layout,
  .planning-weeks-grid {
    grid-template-columns: 1fr;
  }

  .planning-week-card {
    max-height: 520px;
  }
}

@media (max-width: 650px) {
  .planning-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .planning-section-header .meta-tag {
    max-width: 100%;
    white-space: normal;
  }

  .planning-week-card {
    padding: 14px;
  }

  .planning-ticket-top .ticket-status-badge {
    max-width: 100%;
  }
}

/* ==========================================
   UNPLANNED SMAP WORK
   ========================================== */
.unplanned-section {
  margin-top: 28px;
  min-width: 0;
}

.unplanned-section-header {
  margin-bottom: 16px;
}

.unplanned-eyebrow {
  color: hsl(var(--color-orange));
}

.unplanned-count {
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.28);
  color: hsl(var(--color-orange));
}

.unplanned-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 10px 30px -10px var(--glass-shadow), 0 0 0 1px rgba(245, 158, 11, 0.05);
}

.unplanned-items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  max-height: 620px;
  padding-right: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.unplanned-items-grid .planning-ticket {
  height: fit-content;
}

.unplanned-empty {
  grid-column: 1 / -1;
  min-height: 120px;
}

@media (max-width: 1100px) {
  .unplanned-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .unplanned-items-grid {
    grid-template-columns: 1fr;
  }

  .unplanned-card {
    padding: 14px;
  }
}


/* ==========================================
   SMAP REPORTING WALLBOARD TAB
   ========================================== */
.smap-report-view {
  min-width: 0;
}

.smap-report-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.smap-report-heading h2 {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.smap-report-heading p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.smap-report-heading p strong {
  color: hsl(var(--color-blue));
}

.smap-report-generated {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.smap-report-generated strong {
  color: var(--text-main);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.smap-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, 0.9fr) minmax(300px, 1.1fr);
  grid-template-areas:
    "primary secondary weekly escalations"
    "total total weekly escalations";
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.smap-report-panel,
.smap-report-total {
  border-radius: var(--radius-md);
}

.smap-report-panel {
  min-width: 0;
  padding: 16px;
}

.smap-report-panel > h3,
.smap-report-panel-heading h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.smap-report-primary { grid-area: primary; }
.smap-report-secondary { grid-area: secondary; }
.smap-report-weekly { grid-area: weekly; display: flex; flex-direction: column; }
.smap-report-escalations { grid-area: escalations; display: flex; flex-direction: column; min-height: 430px; }
.smap-report-total { grid-area: total; }

.smap-report-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.smap-report-status-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(46px, auto) minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 8px 8px 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-inset);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.smap-report-status-row.success {
  border-color: rgba(16, 185, 129, 0.85);
  background: rgba(16, 185, 129, 0.07);
}

.smap-report-status-row.warning {
  border-color: rgba(245, 158, 11, 0.82);
  background: rgba(245, 158, 11, 0.09);
}

.smap-report-status-row.danger {
  border-color: rgba(239, 68, 68, 0.90);
  background: rgba(239, 68, 68, 0.12);
}

.smap-report-status-count {
  min-width: 46px;
  font-family: var(--font-heading);
  font-size: 39px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -1.5px;
}

.smap-report-status-label {
  min-width: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.smap-report-status-row.danger .smap-report-status-label,
.smap-report-status-row.warning .smap-report-status-label {
  color: var(--text-main);
}

.smap-report-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.smap-report-status-row.success .smap-report-status-icon { background: #10b981; }
.smap-report-status-row.warning .smap-report-status-icon { background: #f59e0b; }
.smap-report-status-row.danger .smap-report-status-icon { background: #ef4444; }

.smap-report-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.smap-flow-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
  flex: 1;
}

.smap-flow-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 145px;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-inset);
}

.smap-flow-card.created {
  border-color: rgba(59, 130, 246, 0.38);
}

.smap-flow-card.resolved {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.06);
}

.smap-flow-value {
  font-family: var(--font-heading);
  font-size: 58px;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -2px;
}

.smap-flow-label {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
}

.smap-flow-balance {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-inset);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.smap-flow-balance.positive {
  background: rgba(16, 185, 129, 0.10);
  color: #10b981;
}

.smap-flow-balance.negative {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}

.smap-escalation-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  margin-top: 13px;
  padding-right: 3px;
  overflow-y: auto;
}

.smap-escalation-item {
  padding: 10px 11px;
  border: 1px solid var(--glass-border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-inset);
}

.smap-escalation-item.p1 { border-left-color: #ef4444; }
.smap-escalation-item.p2 { border-left-color: #f59e0b; }
.smap-escalation-item.p3 { border-left-color: #3b82f6; }

.smap-escalation-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.smap-escalation-topline > a {
  color: hsl(var(--color-blue));
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.smap-escalation-priority {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
}

.smap-escalation-item.p2 .smap-escalation-priority {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.smap-escalation-item.p3 .smap-escalation-priority {
  background: rgba(59, 130, 246, 0.14);
  color: #3b82f6;
}

.smap-escalation-summary {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.smap-escalation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.smap-escalation-meta > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smap-escalation-meta > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.smap-report-total {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 112px;
  padding: 18px 22px;
}

.smap-report-total-value {
  font-family: var(--font-heading);
  font-size: 66px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -2px;
}

.smap-report-total > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.smap-report-total strong {
  font-family: var(--font-heading);
  font-size: 18px;
}

.smap-report-total span:not(.smap-report-total-value) {
  color: var(--text-muted);
  font-size: 13px;
}

.smap-report-total b {
  color: var(--text-main);
}

.smap-report-empty {
  padding: 20px 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1180px) {
  .smap-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "primary secondary"
      "weekly escalations"
      "total total";
  }
}

@media (max-width: 720px) {
  .smap-report-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .smap-report-generated {
    align-items: flex-start;
  }

  .smap-report-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "primary"
      "secondary"
      "weekly"
      "escalations"
      "total";
  }

  .smap-report-escalations {
    min-height: 360px;
  }

  .smap-report-total-value {
    font-size: 52px;
  }
}

/* ==========================================
   WHD + SMAP REPORT LAYOUT
   ========================================== */
.smap-report-grid {
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr) minmax(360px, 1.15fr);
  grid-template-areas:
    "whd smap escalations"
    "summary summary escalations";
  gap: 14px;
  align-items: stretch;
}

.smap-report-whd { grid-area: whd; }
.smap-report-smap { grid-area: smap; }
.smap-report-escalations {
  grid-area: escalations;
  min-height: 640px;
  max-height: 820px;
}
.smap-report-summary {
  grid-area: summary;
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-md);
}

.smap-report-whd .smap-report-status-list,
.smap-report-smap .smap-report-status-list {
  max-height: 560px;
  padding-right: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.smap-report-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.smap-report-summary-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.smap-report-total-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 104px;
  padding: 14px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-inset);
}

.smap-report-total-block > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.smap-report-total-block strong {
  font-family: var(--font-heading);
  font-size: 16px;
}

.smap-report-total-block span:not(.smap-report-total-value) {
  color: var(--text-muted);
  font-size: 12px;
}

.smap-report-total-block b {
  color: var(--text-main);
}

.smap-report-weekly-inline {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.smap-report-weekly-inline .smap-flow-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.smap-report-weekly-inline .smap-flow-card {
  min-height: 92px;
  padding: 13px 16px;
}

.smap-report-weekly-inline .smap-flow-value {
  font-size: 42px;
}

.smap-report-weekly-inline .smap-flow-label {
  margin-top: 5px;
  font-size: 13px;
}

.smap-escalation-priority {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .smap-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "whd smap"
      "escalations escalations"
      "summary summary";
  }

  .smap-report-escalations {
    min-height: 420px;
    max-height: 620px;
  }
}

@media (max-width: 720px) {
  .smap-report-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "whd"
      "smap"
      "escalations"
      "summary";
  }

  .smap-report-summary-totals,
  .smap-report-weekly-inline .smap-flow-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .smap-report-total-block {
    padding: 13px 14px;
  }

  .smap-report-total-value {
    font-size: 48px;
  }
}

/* ==========================================
   CLICK-THROUGH REPORT TICKET LISTS
   ========================================== */
.report-clickable {
  cursor: pointer;
  outline: none;
}

.report-clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.smap-report-status-row.report-clickable {
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.smap-report-status-row.report-clickable:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-focus);
  box-shadow: 0 8px 18px -12px var(--glass-shadow);
}

.smap-report-status-row.success.report-clickable:hover {
  border-color: #10b981;
}

.smap-report-status-row.warning.report-clickable:hover {
  border-color: #f59e0b;
}

.smap-report-status-row.danger.report-clickable:hover {
  border-color: #ef4444;
}

.smap-report-status-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  color: hsl(var(--color-blue));
  background: rgba(59, 130, 246, 0.12);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.smap-report-total-block.report-clickable,
.smap-flow-card.report-clickable {
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.smap-report-total-block.report-clickable:hover,
.smap-flow-card.report-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-focus);
  background: var(--glass-bg);
  box-shadow: 0 10px 24px -16px var(--glass-shadow);
}

#reportEscalationCount.report-clickable:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.22);
}

.report-ticket-modal-content {
  max-width: 1180px;
  overflow: hidden;
}

.report-ticket-modal-header {
  padding-right: 48px;
}

.report-ticket-modal-header h2 {
  margin-top: 3px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
}

.report-ticket-table-scroll {
  max-height: 66vh;
  overflow: auto;
}

.report-ticket-table {
  min-width: 1050px;
}

.report-ticket-table th:first-child,
.report-ticket-table td:first-child {
  min-width: 190px;
}

.report-ticket-table th:nth-child(2),
.report-ticket-table td:nth-child(2) {
  min-width: 280px;
}

.report-ticket-table td {
  vertical-align: middle;
}

.report-modal-empty {
  padding: 32px !important;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 720px) {
  .report-ticket-modal-content {
    padding: 22px 14px 14px;
  }

  .report-ticket-modal-header {
    padding-right: 42px;
  }
}
