/* ============================================
   Ireland Employment Permits Dashboard
   Professional Styles
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #059669;
    --accent-light: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #7c3aed;
    --orange: #ea580c;

    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-header: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

/* ---------- Loading Screen ---------- */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

.loading-content p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Error Overlay ---------- */
.error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.error-content {
    text-align: center;
    color: #fff;
    padding: 3rem;
    background: #1e293b;
    border-radius: var(--radius-lg);
    max-width: 480px;
}

.error-content i {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 1rem;
}

.error-content h2 {
    margin-bottom: 0.5rem;
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-retry {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-retry:hover {
    background: var(--primary-light);
}

/* ---------- Header ---------- */
.header {
    background: var(--bg-header);
    color: #fff;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header h1 i {
    color: var(--primary-light);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: var(--accent);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---------- Year Selector ---------- */
.year-selector-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
}

.year-selector-inner {
    background: var(--bg-card);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}

.year-selector-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.year-selector-label i {
    color: var(--primary-light);
}

.year-buttons {
    display: flex;
    gap: 0.35rem;
}

.year-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.year-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.year-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.year-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.year-indicator {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-left: auto;
}

.year-indicator strong {
    color: var(--primary);
    font-size: 1rem;
}

.year-badge {
    background: var(--primary) !important;
    font-size: 0.85rem !important;
    padding: 0.3rem 0.85rem !important;
    letter-spacing: 0.05em;
}

.year-badge::before {
    display: none;
}

.year-note-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.85rem 2rem 0;
}

.year-note-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    color: var(--text);
    box-shadow: var(--shadow);
}

.year-note-card i {
    color: var(--primary);
    font-size: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.year-note-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ---------- KPI Section ---------- */
.kpi-section {
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 0 2rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon.blue    { background: #dbeafe; color: var(--primary); }
.kpi-icon.green   { background: #d1fae5; color: var(--accent); }
.kpi-icon.purple  { background: #ede9fe; color: var(--purple); }
.kpi-icon.orange  { background: #ffedd5; color: var(--orange); }
.kpi-icon.teal    { background: #ccfbf1; color: #0f766e; }
.kpi-icon.yellow  { background: #fef3c7; color: #b45309; }
.kpi-icon.rose    { background: #ffe4e6; color: #be123c; }

.kpi-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value-textual {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kpi-value-company {
    font-size: 0.95rem;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ---------- Tab Content ---------- */
.tab-content {
    display: none;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.tab-content.active { display: block; }

.tab-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-header h2 i {
    color: var(--primary-light);
}

.tab-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

/* ---------- Filters Bar ---------- */
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 160px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label i {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-light);
}

.range-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-range {
    flex: 1;
    accent-color: var(--primary);
    cursor: pointer;
}

.range-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
}

.btn-reset {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-end;
}

.btn-reset:hover {
    background: #fff;
    border-color: var(--text-muted);
    color: var(--text);
}

/* ---------- Content Grid (Charts) ---------- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 0; /* prevent grid blowout */
}

.chart-container h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chart-subtitle {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.chart-container canvas {
    max-height: 350px;
}

/* ---------- Table Container ---------- */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-info {
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--border-light);
}

.btn-export {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-export:hover {
    background: var(--primary-dark);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--bg-header);
    color: #fff;
    padding: 0.75rem 0.625rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    user-select: none;
}

.data-table thead th.sortable {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table thead th.sortable:hover {
    background: #1e293b;
}

.data-table thead th.sortable::after {
    content: ' \2195';
    opacity: 0.4;
    font-size: 0.7rem;
}

.data-table thead th.sorted-asc::after {
    content: ' \2191';
    opacity: 1;
}

.data-table thead th.sorted-desc::after {
    content: ' \2193';
    opacity: 1;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

.data-table tfoot tr {
    background: #eaf1fb;
    border-top: 2px solid var(--primary-light);
}

.data-table tfoot td {
    padding: 0.8rem 0.625rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.data-table td {
    padding: 0.625rem;
    white-space: nowrap;
}

.data-table td:first-child {
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    width: 50px;
}

.data-table td:nth-child(2) {
    font-weight: 500;
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td:nth-child(3) {
    font-weight: 700;
    color: var(--primary);
}

.data-table td:nth-child(4) {
    color: var(--accent);
    font-weight: 600;
}

.permit-bar {
    display: inline-block;
    height: 6px;
    background: var(--primary-light);
    border-radius: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: width 0.3s;
}

/* ---------- Pagination ---------- */
.pagination {
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-top: 1px solid var(--border);
    background: var(--border-light);
    flex-wrap: wrap;
}

.pagination button {
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text);
}

.pagination button:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Footer ---------- */
.footer {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p + p {
    margin-top: 0.25rem;
}

/* ---------- Responsive ---------- */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet portrait / large phone */
@media (max-width: 768px) {
    html { font-size: 13px; }

    .header { padding: 1rem; }
    .header h1 { font-size: 1.15rem; }
    .header h1 i { font-size: 1rem; }
    .subtitle { font-size: 0.78rem; }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .kpi-section { padding: 0 0.75rem; margin: 1rem auto; }

    .year-selector-section { padding: 0.75rem 0.75rem 0; }
    .year-selector-inner { padding: 0.6rem 0.75rem; gap: 0.75rem; }
    .year-indicator { margin-left: 0; font-size: 0.8rem; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .kpi-card { padding: 1rem; gap: 0.75rem; }
    .kpi-icon { width: 42px; height: 42px; font-size: 1rem; }
    .kpi-value { font-size: 1.25rem; }
    .kpi-label { font-size: 0.72rem; }

    /* Tab nav: horizontal scroll with fade hint */
    .tab-nav {
        padding: 0 0.75rem;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .tab-nav::-webkit-scrollbar { display: none; }
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }

    .tab-content { padding: 0.75rem; }
    .tab-header h2 { font-size: 1.1rem; }
    .tab-desc { font-size: 0.82rem; }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .filter-group { min-width: unset; }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .chart-container { padding: 1rem; }
    .chart-container canvas { max-height: 280px; }

    .table-info {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination {
        padding: 0.75rem;
        gap: 0.2rem;
    }
    .pagination button {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .footer { padding: 1.5rem 0.75rem; }
}

/* Phone */
@media (max-width: 480px) {
    html { font-size: 12.5px; }

    .header { padding: 0.75rem; }
    .header h1 { font-size: 1.05rem; }
    .subtitle { font-size: 0.72rem; line-height: 1.4; }

    .kpi-section { padding: 0 0.5rem; margin: 0.75rem auto; }

    .year-selector-section { padding: 0.5rem 0.5rem 0; }
    .year-selector-inner { padding: 0.5rem 0.65rem; gap: 0.5rem; }
    .year-selector-label { font-size: 0.8rem; }
    .year-btn { padding: 0.4rem 1rem; font-size: 0.82rem; }
    .year-indicator { font-size: 0.75rem; }
    .year-indicator strong { font-size: 0.85rem; }

    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .kpi-card { padding: 0.75rem; gap: 0.5rem; flex-direction: row; }
    .kpi-icon { width: 36px; height: 36px; font-size: 0.9rem; border-radius: 6px; }
    .kpi-value { font-size: 1.1rem; }
    .kpi-label { font-size: 0.68rem; }

    .tab-nav { padding: 0 0.5rem; }
    .tab-btn { padding: 0.65rem 0.75rem; font-size: 0.75rem; }
    .tab-btn i { font-size: 0.7rem; }

    .tab-content { padding: 0.5rem; padding-bottom: 2rem; }
    .tab-header h2 { font-size: 1rem; flex-wrap: wrap; }
    .tab-desc { font-size: 0.78rem; margin-bottom: 0.75rem; }

    .filters-bar { padding: 0.6rem; gap: 0.6rem; margin-bottom: 1rem; }
    .filter-input, .filter-select {
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
    }
    .btn-reset { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

    .content-grid { gap: 0.75rem; margin-bottom: 1rem; }
    .chart-container { padding: 0.75rem; }
    .chart-container h3 { font-size: 0.85rem; margin-bottom: 0.75rem; }
    .chart-container canvas { max-height: 240px; }

    .table-container { border-radius: var(--radius); }
    .table-info { padding: 0.6rem 0.75rem; font-size: 0.78rem; }
    .btn-export { padding: 0.35rem 0.75rem; font-size: 0.75rem; }

    .data-table { font-size: 0.78rem; }
    .data-table thead th {
        padding: 0.6rem 0.5rem;
        font-size: 0.7rem;
    }
    .data-table td {
        padding: 0.5rem;
    }
    .data-table td:first-child { width: 36px; }
    .data-table td:nth-child(2) { max-width: 180px; }

    .pagination {
        padding: 0.6rem;
        gap: 0.15rem;
    }
    .pagination button {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        min-width: 28px;
    }

    .footer { padding: 1rem 0.5rem; font-size: 0.72rem; }

    /* Error/loading overlays on mobile */
    .error-content { padding: 2rem 1.5rem; max-width: 90vw; }
    .loading-content h2 { font-size: 1.2rem; }
}

/* Very small phone */
@media (max-width: 360px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .header h1 { font-size: 0.95rem; }
    .tab-btn { padding: 0.6rem 0.6rem; font-size: 0.7rem; }
    .tab-btn i { display: none; }
    .chart-container canvas { max-height: 200px; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Touch-friendly: prevent iOS zoom on focus & ensure min touch target */
@media (max-width: 768px) {
    input, select, button, textarea {
        font-size: max(16px, 1em); /* prevents iOS zoom on focus */
    }
    .filter-input, .filter-select {
        min-height: 44px; /* iOS HIG minimum touch target */
    }
    .tab-btn, .btn-reset, .btn-export, .btn-retry, .pagination button {
        min-height: 40px;
    }
}

/* Highlight for search */
mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* No data state */
.no-data {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.no-data i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}