/* ============================================================
   Ortaklık Yönetim Sistemi - Apple Cupertino Design Language
   ============================================================ */

:root {
    --bg-primary: #F5F5F7;
    --bg-card: #FFFFFF;
    --bg-card-translucent: rgba(255, 255, 255, 0.72);
    --color-primary: #007AFF;
    --color-primary-hover: #0056CC;
    --color-success: #34C759;
    --color-warning: #FF9500;
    --color-danger: #FF3B30;
    --color-info: #5AC8FA;
    --color-secondary: #8E8E93;
    --color-text: #1D1D1F;
    --color-text-secondary: #86868B;
    --color-text-tertiary: #AEAEB2;
    --color-border: rgba(0, 0, 0, 0.06);
    --color-divider: rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.05);
    --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-height: 56px;
    --transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    overflow-y: scroll;
}

/* ---- Layout ---- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.main-content {
    flex: 1;
    padding: 24px 24px 48px;
}

.main-shell {
    max-width: 1440px;
    margin: 0 auto;
}

/* ---- Inline Filters ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 4px;
}

.filter-bar .filter-icon {
    color: var(--color-text-tertiary);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.filter-bar select,
.filter-bar input[type="month"] {
    height: 36px;
    padding: 0 32px 0 12px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    min-width: 120px;
    flex: 0 0 160px;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
    margin-bottom: 0;
}

.filter-bar .filter-clear {
    font-size: 13px;
    color: var(--color-text-tertiary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.filter-bar .filter-clear:hover {
    color: var(--color-danger);
}

.filter-bar .filter-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- Header (Frosted Glass Top Nav) ---- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 70;
    height: var(--header-height);
    background: var(--bg-card-translucent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.top-nav-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 16px;
}

.top-nav-brand i {
    font-size: 22px;
    color: var(--color-primary);
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
    margin-left: auto;
}

.top-nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    height: 100%;
    display: inline-flex;
    align-items: center;
    position: relative;
    transition: color 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.top-nav-links a:hover {
    color: var(--color-primary);
}

.top-nav-links a.active {
    color: var(--color-primary);
}

.top-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: 2px 2px 0 0;
}

.top-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.top-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.top-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #0A84FF, #007AFF);
}

.top-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
    white-space: nowrap;
}

.top-user-logout-form {
    margin: 0;
}

.top-user-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 200ms ease;
}

.top-user-logout:hover {
    color: var(--color-danger);
    background: rgba(255, 59, 48, 0.08);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-text);
    cursor: pointer;
    padding: 4px;
}

/* ---- Page Hero ---- */
.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text);
    margin: 0;
    line-height: 1.2;
}

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

/* ---- Footer ---- */
.app-footer {
    height: 48px;
    border-top: 1px solid var(--color-border);
    background: transparent;
    margin-top: auto;
}

.footer-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.footer-devtools {
    position: relative;
}

.devtools-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms;
}

.devtools-btn:hover {
    color: var(--color-text);
}

.devtools-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.devtools-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 200ms;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 1px solid var(--color-border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.card-header h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* ---- Bento Grid ---- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.bento-grid .card.span-2 {
    grid-column: span 2;
}

.bento-grid .card.span-3 {
    grid-column: span 3;
}

.bento-grid .card.span-4 {
    grid-column: span 4;
}

/* ---- Stat Cards ---- */
.stat-card {
    text-align: left;
}

.stat-card .stat-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-card .stat-suffix {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    margin-left: 4px;
}

.stat-card .stat-change {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
}

.stat-card .stat-change.positive {
    color: var(--color-success);
}

.stat-card .stat-change.negative {
    color: var(--color-danger);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
    font-family: var(--font-family);
    min-height: 36px;
    justify-content: center;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 32px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    min-height: 44px;
    border-radius: var(--radius-md);
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-divider);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

table td.wrap-ok {
    white-space: normal;
}

table td.td-wide {
    max-width: 300px;
}

table td.td-narrow {
    max-width: 120px;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-money {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 15px;
}

.text-money.positive {
    color: var(--color-success);
}

.text-money.negative {
    color: var(--color-danger);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: rgba(0, 122, 255, 0.12);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(52, 199, 89, 0.12);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.12);
    color: var(--color-warning);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.12);
    color: var(--color-danger);
}

.badge-info {
    background: rgba(90, 200, 250, 0.12);
    color: #0A84FF;
}

.badge-secondary {
    background: rgba(142, 142, 147, 0.12);
    color: var(--color-secondary);
}

/* ---- Segmented Control (Assets Tabs) ---- */
.segmented-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    max-width: 100%;
    overflow-x: auto;
}

.segmented-control a,
.segmented-control button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
}

.segmented-control a:hover,
.segmented-control button:hover {
    color: var(--color-text);
}

.segmented-control a.active,
.segmented-control button.active {
    background: #fff;
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.segmented-control .badge {
    font-size: 12px;
    min-width: 20px;
}

/* ---- Auth Pages ---- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.auth-card.auth-card-wide {
    max-width: 560px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.auth-brand-icon {
    font-size: 32px;
    color: var(--color-primary);
}

.auth-brand-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-control {
    min-height: 48px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 16px;
}

.auth-form .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.auth-form .btn-lg {
    margin-top: 8px;
}

.auth-alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.auth-alert-error {
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.15);
    color: #D32F2F;
}

.auth-alert-warning {
    background: rgba(255, 149, 0, 0.08);
    border: 1px solid rgba(255, 149, 0, 0.15);
    color: #E65100;
}

.auth-code-input {
    letter-spacing: 0.35em;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.auth-qr-shell {
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-secret-label {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-bottom: 6px;
}

.auth-secret {
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--color-text-secondary);
}

.auth-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    border: none;
    background: none;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 200ms ease;
}

.auth-info-btn:hover {
    opacity: 0.7;
}

.modal.auth-modal-info {
    max-width: 480px;
}

.input-password-wrapper {
    position: relative;
}

.input-password-wrapper .form-control {
    padding-right: 48px;
}

.input-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 200ms ease;
    z-index: 2;
}

.input-password-toggle:hover {
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .auth-body {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 20px;
    }
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    background: var(--bg-card);
    color: var(--color-text);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

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

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.two-col-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-check label {
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text);
    cursor: pointer;
    margin-bottom: 0;
}

/* ---- Modal (Frosted Glass) ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: opacity 350ms ease, transform 350ms ease;
}

.modal.modal-wide {
    max-width: 680px;
}

.modal table .form-control {
    min-height: 36px;
    padding: 4px 8px;
    font-size: 13px;
}

.comp-matrix {
    overflow-x: auto;
}

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

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.modal-header .modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.modal-header .modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-divider);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-secondary);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.empty-state p {
    font-size: 15px;
}

/* ---- Grid Utilities ---- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- Transaction list items ---- */
.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.tx-item:last-child {
    border-bottom: none;
}

.tx-item .tx-info {
    flex: 1;
}

.tx-item .tx-desc {
    font-size: 15px;
    font-weight: 500;
}

.tx-item .tx-date {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.tx-item .tx-amount {
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.tx-item .tx-amount.credit {
    color: var(--color-success);
}

.tx-item .tx-amount.debit {
    color: var(--color-danger);
}

/* ---- Icons (Phosphor) ---- */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.icon.ph {
    font-size: 18px;
}

.empty-state .empty-icon .ph {
    font-size: 52px;
}

/* ---- Accessibility / Focus ---- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.modal-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.form-control:focus-visible {
    outline: none;
}

/* ---- Validation / Feedback ---- */
.form-group .field-error {
    margin-top: 8px;
    color: var(--color-danger);
    font-size: 13px;
    font-weight: 500;
}

.form-control.is-invalid {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

/* ---- Loading buttons ---- */
.btn.is-loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-secondary.is-loading::after {
    border-color: rgba(0, 0, 0, 0.45);
    border-top-color: transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Float Label Fields ---- */
.form-group.float-field {
    position: relative;
    margin-bottom: 16px;
}

.form-group.float-field > label {
    position: absolute;
    left: 16px;
    top: 8px;
    transform: none;
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--color-text-secondary);
    pointer-events: none;
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.2s ease;
    z-index: 2;
}

.form-group.float-field > .form-control {
    min-height: 56px;
    padding: 24px 16px 8px;
}

.form-group.float-field textarea.form-control {
    min-height: 96px;
    padding-top: 24px;
}

.form-group.float-field.is-active > label,
.form-group.float-field > .form-control:focus + label {
    top: 8px;
    transform: none;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.form-group.float-field:not(.is-active) > label {
    color: var(--color-text-secondary);
}

.form-group.float-field > .form-control::placeholder {
    color: transparent;
}

/* ---- Dropdown Select (Choices.js) ---- */
.form-group.float-field .choices {
    margin: 0;
}

.form-group.float-field .choices__inner {
    min-height: 56px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: 24px 42px 8px 16px;
    font-size: 15px;
}

.form-group.float-field .choices__list--single {
    padding: 0;
}

.form-group.float-field .choices[data-type*='select-one']::after {
    right: 16px;
    margin-top: -3px;
}

.form-group.float-field .choices.is-focused .choices__inner {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-group.float-field .choices.is-invalid .choices__inner {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

.form-group.float-field .choices__list--dropdown,
.form-group.float-field .choices__list[aria-expanded] {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-top: 8px;
}

.form-group.float-field .choices__item {
    font-size: 15px;
}

/* ---- Modal helpers ---- */
body.modal-open {
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-grid .card.span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .top-nav-links {
        display: none;
    }
    .top-user-pill {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .top-nav-shell {
        padding: 0 16px;
    }
    .main-content {
        padding: 16px 16px 32px;
    }
    .page-title {
        font-size: 28px;
    }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-grid .card.span-2,
    .bento-grid .card.span-3,
    .bento-grid .card.span-4 {
        grid-column: span 1;
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .two-col-form {
        grid-template-columns: 1fr;
    }
    .filter-bar .btn {
        width: auto;
    }
}

/* ============================================================
   Timeline / İşlem Akışı
   ============================================================ */

.timeline-filters {
    margin-bottom: 24px;
}

.timeline-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.timeline-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.timeline-summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tl-summary-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tl-income .tl-summary-icon {
    background: rgba(52, 199, 89, 0.1);
    color: var(--color-success);
}

.tl-expense .tl-summary-icon {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-danger);
}

.tl-transfer .tl-summary-icon {
    background: rgba(0, 122, 255, 0.1);
    color: var(--color-primary);
}

.tl-net .tl-summary-icon {
    background: rgba(142, 142, 147, 0.1);
    color: var(--color-secondary);
}

.tl-net.positive .tl-summary-icon {
    background: rgba(52, 199, 89, 0.1);
    color: var(--color-success);
}

.tl-net.negative .tl-summary-icon {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-danger);
}

.tl-summary-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tl-summary-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tl-summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-summary-value small {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.tl-summary-count {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.timeline-container {
    position: relative;
}

.timeline-day-group {
    margin-bottom: 32px;
}

.timeline-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-divider);
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-day-date {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-day-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.timeline-day-date h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.timeline-day-totals {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tl-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.tl-badge-income {
    background: rgba(52, 199, 89, 0.1);
    color: #1a8f3c;
}

.tl-badge-expense {
    background: rgba(255, 59, 48, 0.1);
    color: #d32f2f;
}

.tl-badge-transfer {
    background: rgba(0, 122, 255, 0.1);
    color: #0056cc;
}

.timeline-events {
    position: relative;
    padding-left: 28px;
}

.timeline-event {
    position: relative;
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.tl-event-connector {
    position: absolute;
    left: -28px;
    top: 0;
    bottom: -12px;
    width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tl-event-line {
    width: 2px;
    flex: 1;
    background: var(--color-divider);
}

.timeline-event:last-child .tl-event-line {
    background: transparent;
}

.tl-event-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    z-index: 1;
    position: absolute;
    top: 16px;
    left: 0;
}

.tl-event-income .tl-event-dot {
    background: rgba(52, 199, 89, 0.12);
    color: var(--color-success);
}

.tl-event-expense .tl-event-dot {
    background: rgba(255, 59, 48, 0.12);
    color: var(--color-danger);
}

.tl-event-transfer .tl-event-dot {
    background: rgba(0, 122, 255, 0.12);
    color: var(--color-primary);
}

.tl-event-card {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: var(--transition);
    position: relative;
}

.tl-event-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 0, 0, 0.1);
}

.tl-event-income .tl-event-card {
    border-left: 3px solid var(--color-success);
}

.tl-event-expense .tl-event-card {
    border-left: 3px solid var(--color-danger);
}

.tl-event-transfer .tl-event-card {
    border-left: 3px solid var(--color-primary);
}

.tl-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.tl-event-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tl-event-source-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-tertiary);
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.tl-event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
}

.tl-event-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.tl-amount-gross {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.tl-event-income .tl-amount-gross {
    color: var(--color-success);
}

.tl-event-expense .tl-amount-gross {
    color: var(--color-danger);
}

.tl-event-transfer .tl-amount-gross {
    color: var(--color-primary);
}

.tl-amount-detail {
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.tl-event-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 8px;
    line-height: 1.4;
}

.tl-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 8px;
}

.tl-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.tl-meta-item i {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

.tl-meta-item.tl-unofficial {
    color: var(--color-warning);
}

.tl-meta-item.tl-unofficial i {
    color: var(--color-warning);
}

.tl-event-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-divider);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.tl-detail-item {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.tl-detail-item strong {
    font-weight: 600;
    color: var(--color-text);
}

.tl-event-time {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--color-text-tertiary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .timeline-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .timeline-summary-card {
        padding: 14px 16px;
        gap: 10px;
    }

    .tl-summary-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .tl-summary-value {
        font-size: 16px;
    }

    .timeline-day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .timeline-events {
        padding-left: 20px;
    }

    .tl-event-connector {
        left: -20px;
        width: 20px;
    }

    .tl-event-dot {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .tl-event-header {
        flex-direction: column;
        gap: 6px;
    }

    .tl-event-amount {
        align-items: flex-start;
    }

    .tl-event-card {
        padding: 12px 14px;
    }

    .tl-event-time {
        position: static;
        margin-top: 6px;
        display: block;
    }
}

@media (max-width: 480px) {
    .timeline-summary-grid {
        grid-template-columns: 1fr;
    }

    .tl-day-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* ── Impact Panel (slide-out detail) ── */
.impact-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.impact-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}
.impact-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 520px;
    max-width: 92vw;
    height: 100vh;
    background: var(--surface, #fff);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.impact-panel-overlay.active .impact-panel {
    transform: translateX(0);
}
.impact-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider, #e5e7eb);
    flex-shrink: 0;
}
.impact-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text, #1a1a2e);
}
.impact-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary, #6b7280);
    transition: background 0.15s, color 0.15s;
}
.impact-panel-close:hover {
    background: var(--bg-hover, #f3f4f6);
    color: var(--text, #1a1a2e);
}
.impact-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.impact-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 0;
    color: var(--text-tertiary, #9ca3af);
    font-size: 13px;
}
.impact-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--divider, #e5e7eb);
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: impactSpin 0.7s linear infinite;
}
@keyframes impactSpin {
    to { transform: rotate(360deg); }
}
.impact-group {
    margin-bottom: 16px;
}
.impact-group:last-child {
    margin-bottom: 0;
}
.impact-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--divider, #e5e7eb);
}
.impact-group-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 15px;
    flex-shrink: 0;
}
.impact-group-icon.kayit { background: #ede9fe; color: #7c3aed; }
.impact-group-icon.proje { background: #dbeafe; color: #2563eb; }
.impact-group-icon.ortak { background: #fce7f3; color: #db2777; }
.impact-group-icon.cuzdan { background: #d1fae5; color: #059669; }
.impact-group-icon.stopaj { background: #fef3c7; color: #d97706; }
.impact-group-icon.gelir { background: #d1fae5; color: #059669; }
.impact-group-icon.gider { background: #fee2e2; color: #dc2626; }
.impact-group-icon.islem { background: #e0e7ff; color: #4f46e5; }
.impact-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #1a1a2e);
}
.impact-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    gap: 12px;
}
.impact-item + .impact-item {
    border-top: 1px solid rgba(0,0,0,0.03);
}
.impact-item-label {
    color: var(--text-secondary, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}
.impact-item-value {
    text-align: right;
    font-weight: 500;
    color: var(--text, #1a1a2e);
    word-break: break-word;
}
.impact-item-value.positive { color: #059669; }
.impact-item-value.negative { color: #dc2626; }
.impact-item-value a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    font-weight: 600;
}
.impact-item-value a:hover {
    text-decoration: underline;
}
.impact-item-sublabel {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary, #9ca3af);
    font-weight: 400;
    margin-top: 1px;
}
.impact-item-meta {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary, #6b7280);
    margin-top: 2px;
}
.impact-flow {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--bg-hover, #f9fafb);
    border: 1px solid var(--divider, #e5e7eb);
    border-radius: 8px;
}
.impact-flow-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}
.impact-flow-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.impact-flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text, #1a1a2e);
    position: relative;
}
.impact-flow-step + .impact-flow-step::before {
    content: '';
    position: absolute;
    left: 11px;
    top: -6px;
    width: 2px;
    height: 12px;
    background: var(--divider, #e5e7eb);
}
.impact-flow-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.impact-flow-dot.credit { background: #d1fae5; color: #059669; }
.impact-flow-dot.debit { background: #fee2e2; color: #dc2626; }
.impact-flow-dot.info { background: #dbeafe; color: #2563eb; }

.clickable-row {
    cursor: pointer;
    transition: background 0.12s ease;
}
.clickable-row:hover {
    background: rgba(99, 102, 241, 0.04) !important;
}
