/* StokPlus+ Finans Pro — Premium muhasebe paneli */

/* Sol sidebar — Finansal Yönetim açılır alt menü */
.sidebar-fin-group {
    display: flex;
    flex-direction: column;
}

.sidebar-fin-toggle {
    gap: 0;
}

.sidebar-fin-chevron {
    width: 1.125rem;
    font-size: 0.6875rem;
    line-height: 1;
    opacity: 0.38;
    color: currentColor;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}

.sidebar-fin-toggle:hover .sidebar-fin-chevron,
.sidebar-fin-group.is-expanded .sidebar-fin-chevron {
    opacity: 0.72;
}

.sidebar-fin-group.is-expanded .sidebar-fin-chevron {
    transform: rotate(180deg);
}

.sidebar-fin-children {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0.2rem 0 0.45rem 3.35rem;
    padding: 0.3rem 0 0.45rem 0.9rem;
    border-left: 2px solid rgba(220, 38, 38, 0.12);
}

html[data-theme="light"] .sidebar-fin-children {
    border-left-color: rgba(220, 38, 38, 0.18);
}

.app-sidebar.sidebar-collapsed .sidebar-fin-children,
.app-sidebar.sidebar-collapsed .sidebar-fin-chevron {
    display: none !important;
}

.sidebar-fin-subitem {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.sidebar-fin-subitem:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

html[data-theme="light"] .sidebar-fin-subitem:hover {
    background: rgba(15, 23, 42, 0.04);
}

.sidebar-fin-subitem.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.2);
}

.sidebar-fin-toggle.finance-parent-open {
    background: rgba(220, 38, 38, 0.07);
    box-shadow: inset 3px 0 0 var(--accent);
}

html[data-theme="light"] .sidebar-fin-toggle.finance-parent-open {
    background: rgba(220, 38, 38, 0.05);
    color: var(--text-primary);
}

.sidebar-fin-group.is-expanded .sidebar-fin-toggle {
    margin-bottom: 0.05rem;
}

.fin-section-desc {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

/* Mobil — sidebar yokken içerik üstü sekme şeridi */
.fin-mobile-subnav {
    margin-bottom: 0.75rem;
}

.fin-mobile-tab-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.fin-mobile-tab-bar .fin-tab {
    min-width: 4.25rem;
    flex-shrink: 0;
}

.fin-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 4.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.75rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.fin-tab i {
    font-size: 0.95rem;
    line-height: 1;
}

.fin-tab span {
    line-height: 1.1;
}

.fin-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.fin-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}

.fin-panel { display: none; }
.fin-panel.active { display: block; }

.fin-health-ring {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.fin-health-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 6px;
    background: conic-gradient(var(--fin-health-color, #10B981) calc(var(--fin-health-pct, 0) * 1%), rgba(148, 163, 184, 0.15) 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.fin-health-inner {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.fin-personel-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.fin-personel-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
    gap: 0.5rem;
}

.fin-personel-metric-label {
    display: block;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.fin-personel-metric-val {
    font-size: 0.8125rem;
    font-weight: 800;
}

.fin-personel-action-btn {
    padding: 0.45rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 800;
    border: 1px solid rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
    color: #f87171;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.fin-personel-action-btn:hover {
    background: var(--accent);
    color: #fff;
}

.fin-ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.75rem;
}

.fin-ratio-card {
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.fin-ratio-card .label {
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.fin-ratio-card .value {
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.2;
}

.fin-ratio-card .hint {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 600;
}

.fin-insight-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fin-insight {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
}

.fin-insight i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.fin-insight--ok { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); color: #34d399; }
.fin-insight--warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.fin-insight--bad { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); color: #f87171; }
.fin-insight--info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.fin-aging-bar {
    display: flex;
    height: 0.65rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border-subtle);
    margin: 0.75rem 0;
}

.fin-aging-seg { height: 100%; min-width: 2px; transition: width 0.3s ease; }

.fin-table-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.fin-table-mini th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-accent);
}

.fin-table-mini th:not(:first-child),
.fin-table-mini td:not(:first-child) { text-align: right; }

.fin-table-mini td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
}

.fin-table-mini tr:last-child td { border-bottom: none; }

.fin-cf-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.fin-cf-row.fin-cf-section {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: none;
    padding-top: 0.85rem;
}

.fin-cf-row.fin-cf-total {
    font-weight: 900;
    border-top: 2px solid var(--border-accent);
    border-bottom: none;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.fin-kdv-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 800;
    border: 1px solid var(--border-subtle);
}

.fin-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 800;
    background: rgba(234, 179, 8, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.25);
}
