/* ═══════════════════════════════════════════════════════════
   MEYS — Mali Evrak Yönetim Sistemi
   Premium Dark Theme — Glassmorphism & Micro-Animations
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    --bg-primary:     #0a0e1a;
    --bg-secondary:   #0f1629;
    --bg-card:        rgba(15, 23, 42, 0.6);
    --bg-card-hover:  rgba(20, 30, 55, 0.8);
    --bg-glass:       rgba(255, 255, 255, 0.04);
    --border:         rgba(255, 255, 255, 0.06);
    --border-active:  rgba(6, 182, 212, 0.4);

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-heading:   #f1f5f9;

    --accent:         #06b6d4;
    --accent-glow:    rgba(6, 182, 212, 0.15);
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --violet:         #0ea5a8;

    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-xl:      20px;

    --shadow-card:    0 4px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow:    0 0 40px rgba(6, 182, 212, 0.08);
    --shadow-hover:   0 8px 40px rgba(6, 182, 212, 0.12);

    --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font:           'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:      'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ══════════════ NAVBAR ══════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.3));
}

.nav-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-icon {
    font-size: 16px;
}

/* ══════════════ MAIN CONTENT ══════════════ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px 60px;
}

/* ══════════════ GLASS CARD ══════════════ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ══════════════ PAGE HEADER ══════════════ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.header-stats {
    display: flex;
    gap: 12px;
}

.header-stat {
    padding: 14px 22px;
    text-align: center;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ══════════════ SECTIONS ══════════════ */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
}

/* ══════════════ NOVA DASHBOARD ══════════════ */
.nova-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
}

.nova-kpi {
    padding: 14px 16px;
}

.nova-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .45px;
}

.nova-kpi-value {
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: -.6px;
}

.nova-kpi-help {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-mono);
}

.nova-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
}

.nova-panel {
    padding: 16px;
}

.nova-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nova-progress {
    margin-top: 10px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}

.nova-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #34d399);
}

.nova-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.nova-item,
.nova-radar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255,255,255,.02);
}

.nova-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.nova-item-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.nova-bullets {
    margin-left: 18px;
    margin-top: 10px;
}

.nova-bullets li {
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.nova-alert {
    margin-top: 10px;
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
}

.nova-alert.danger {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.2);
    color: #fda4af;
}

.nova-alert.warn {
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.2);
    color: #fcd34d;
}

.nova-radar-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.nova-radar-list {
    display: grid;
    gap: 8px;
}

.nova-empty {
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px;
}

.nova-grid-assistant {
    grid-template-columns: 1.1fr .9fr;
}

.ops-assistant-panel,
.ops-alerts-panel {
    min-height: 280px;
}

.ops-assistant-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ops-pill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.ops-pill {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.ops-pill-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ops-pill-value {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
}

.ops-deadline {
    margin: 8px 0 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ops-firm-list {
    display: grid;
    gap: 6px;
}

.ops-firm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.ops-firm-meta {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.alert-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.alert-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.alert-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

.alert-item-desc {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-cta {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
}

.alert-cta:hover {
    text-decoration: underline;
}

.alert-item.severity-critical {
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.08);
}

.alert-item.severity-high {
    border-color: rgba(251, 146, 60, 0.26);
    background: rgba(251, 146, 60, 0.07);
}

.alert-item.severity-medium {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}

.alert-item.severity-info {
    border-color: rgba(6, 182, 212, 0.24);
    background: rgba(6, 182, 212, 0.07);
}

/* ══════════════ PROCESS CARDS ══════════════ */
.process-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.process-card {
    padding: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.process-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--clr, var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.process-card:hover::before,
.process-card.selected::before {
    opacity: 1;
}

.process-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-active);
}

.process-card.selected {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow), var(--shadow-hover);
}

.pc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pc-icon {
    font-size: 24px;
}

.pc-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.pc-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* CSS-only percentage ring */
.pc-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(
        var(--clr, var(--accent)) calc(var(--pct, 0) * 1%),
        rgba(255, 255, 255, 0.06) 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.pc-ring::before {
    content: '';
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    position: absolute;
}

.pc-pct {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.pc-detail {
    display: flex;
    flex-direction: column;
}

.pc-ready {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.pc-ready-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ══════════════ SEND CONTROLS ══════════════ */
.send-controls {
    padding: 28px;
    border-color: var(--border-active);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-input {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.control-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.control-input::placeholder {
    color: var(--text-muted);
}

select.control-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

/* Toggle */
.toggle-group {
    display: flex;
    align-items: center;
    height: 100%;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
    background: var(--accent);
}

.toggle-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Controls Actions */
.controls-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
}

/* ══════════════ BUTTONS ══════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

/* ══════════════ FILTER BAR ══════════════ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ══════════════ MATRIX TABLE ══════════════ */
.matrix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.matrix-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-ready  { background: var(--success); }
.dot-empty  { background: var(--text-muted); }
.dot-sent   { background: var(--accent); }

.matrix-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.matrix-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.matrix-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.th-checkbox { width: 40px; text-align: center; }
.th-process  { width: 50px; text-align: center; }
.th-firma    { min-width: 180px; }
.th-email    { min-width: 200px; }

.matrix-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.matrix-table tbody tr {
    transition: var(--transition);
}

.matrix-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}

.matrix-table tbody tr.row-selected {
    background: rgba(6, 182, 212, 0.08);
}

.td-firma {
    font-weight: 500;
    color: var(--text-heading);
}

.firma-name {
    cursor: default;
}

.td-email {
    color: var(--text-secondary);
    font-size: 12px;
}

.td-date {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.td-status {
    text-align: center;
}

.td-checkbox {
    text-align: center;
}

/* Checkbox custom */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 2px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 16px;
    cursor: default;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 10px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger,
.badge-critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-high {
    background: rgba(251, 146, 60, 0.18);
    color: #fb923c;
}

.badge-medium {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.badge-low {
    background: rgba(6, 182, 212, 0.14);
    color: #06b6d4;
}

.badge-info {
    background: rgba(6, 182, 212, 0.14);
    color: #22d3ee;
}

/* Status pills (history page) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pill-sent  { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.pill-failed { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.pill-dry   { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.file-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* ══════════════ INTEGRITY ══════════════ */
.integrity-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.integrity-card {
    padding: 22px;
    text-align: center;
}

.ic-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.ic-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.missing-details {
    padding: 20px;
}

.missing-summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--warning);
    padding: 4px 0;
}

.missing-list {
    list-style: none;
    margin-top: 12px;
}

.missing-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.missing-list li:last-child {
    border-bottom: none;
}

.missing-list code {
    font-size: 12px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ══════════════ ALERT ══════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ══════════════ EMPTY STATE ══════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state a {
    color: var(--accent);
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* ══════════════ MODAL ══════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-glass);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ══════════════ PROGRESS ══════════════ */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--violet));
    border-radius: 4px;
    transition: width 0.4s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

/* Send Log */
.send-log {
    max-height: 300px;
    overflow-y: auto;
}

.send-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 13px;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.send-log-item.log-success { background: rgba(16, 185, 129, 0.06); }
.send-log-item.log-error   { background: rgba(239, 68, 68, 0.06); }
.send-log-item.log-skip    { background: rgba(245, 158, 11, 0.06); }

.log-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.log-text {
    flex: 1;
    color: var(--text-secondary);
}

.log-firm {
    font-weight: 600;
    color: var(--text-primary);
}

/* Send Summary */
.send-summary {
    padding: 20px;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    text-align: center;
    margin-top: 16px;
}

.send-summary h3 {
    font-size: 16px;
    color: var(--success);
    margin-bottom: 12px;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.summary-stat {
    text-align: center;
}

.summary-stat .s-value {
    font-size: 24px;
    font-weight: 800;
    display: block;
}

.summary-stat .s-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ══════════════ TOAST ══════════════ */
#toast-container {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease-out;
    cursor: pointer;
    max-width: 360px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.toast-error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast-info    { background: linear-gradient(135deg, #0891b2, #06b6d4); }

/* ══════════════ HISTORY TABLE ══════════════ */
.history-table th,
.history-table td {
    padding: 10px 14px;
}

/* ══════════════ FIRM MANAGEMENT ══════════════ */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.firms-table .td-firma {
    font-weight: 600;
}

.firma-link {
    color: var(--text-heading);
    text-decoration: none;
    transition: var(--transition);
}

.firma-link:hover {
    color: var(--accent);
}

.row-inactive {
    opacity: 0.45;
}

/* Editable cell */
.editable-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.editable-cell .cell-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editable-cell .cell-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 13px;
}

.editable-cell .notes-text {
    color: var(--text-muted);
    font-size: 12px;
}

.btn-edit, .btn-save, .btn-cancel {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    transition: var(--transition);
    opacity: 0.5;
    line-height: 1;
}

.editable-cell:hover .btn-edit { opacity: 1; }
.btn-save { opacity: 1; }
.btn-cancel { opacity: 1; }

.action-btns {
    display: flex;
    gap: 4px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 14px;
}

.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
}

/* Form group */
.form-group {
    margin-bottom: 16px;
}

.form-group .control-label {
    display: block;
    margin-bottom: 6px;
}

/* ══════════════ FIRM DETAIL ══════════════ */
.detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-card {
    padding: 20px;
}

.dc-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.dc-value {
    font-size: 15px;
    color: var(--text-primary);
}

/* Document status grid */
.doc-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.doc-status-card {
    padding: 20px;
}

.dsc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dsc-icon {
    font-size: 20px;
}

.dsc-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    flex: 1;
}

.dsc-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 6px;
    font-size: 12px;
    color: var(--accent);
}

.dsc-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .page-header {
        flex-direction: column;
    }

    .header-stats {
        width: 100%;
    }

    .nova-strip {
        grid-template-columns: 1fr 1fr;
    }

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

    .nova-grid-assistant {
        grid-template-columns: 1fr;
    }

    .header-stat {
        flex: 1;
        min-width: auto;
        padding: 12px 10px;
    }

    .process-cards {
        grid-template-columns: 1fr 1fr;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .controls-actions {
        flex-direction: column;
    }

    .controls-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .integrity-cards {
        grid-template-columns: 1fr;
    }

    .ops-pill-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .control-input {
        max-width: none !important;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .nova-strip {
        grid-template-columns: 1fr;
    }
}
