/* Mobile-First Black & White Theme */
:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1e1e1e;
    --text: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --border: #222222;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle i {
    width: 24px;
    height: 24px;
}

/* Search Wrapper - Icon Inside Input */
.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input {
    width: 100%;
    padding: 14px 14px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
}

.search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-card);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item i {
    width: 22px;
    height: 22px;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Settings Form */
.settings-form {
    max-width: 500px;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.icon-input {
    max-width: 100px;
    text-align: center;
    font-size: 24px;
}

/* Main Content */
.app-container {
    min-height: 100vh;
}

.main-content {
    padding-top: 56px;
}

.content {
    padding: 20px 16px;
    padding-bottom: 100px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card.success {
    border-left: 3px solid var(--success);
}

.stat-card.danger {
    border-left: 3px solid var(--danger);
}

.stat-card.info {
    border-left: 3px solid var(--info);
}

.stat-icon {
    margin-bottom: 8px;
}

.stat-icon i {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
    background: var(--bg-hover);
}

.action-btn.primary {
    background: var(--text);
    color: var(--bg);
}

.action-btn i {
    width: 28px;
    height: 28px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.link-btn i {
    width: 16px;
    height: 16px;
}

/* List Items */


.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

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

.list-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.list-item-title {
    font-weight: 500;
    font-size: 15px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.amount {
    font-weight: 600;
    font-size: 15px;
}

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

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

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

/* Progress */
.progress-item {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.progress-ratio {
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

/* Payment Page */
.month-selector {
    margin-bottom: 16px;
}

.month-selector select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mini-stat {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.mini-stat.success {
    border-color: var(--success);
}

.mini-stat.danger {
    border-color: var(--danger);
}

.mini-stat.info {
    border-color: var(--info);
}

.mini-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.mini-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    flex-shrink: 0;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}





.payment-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
}

.payment-item.paid {
    border-left-color: var(--success);
    background: linear-gradient(to right, rgba(22, 163, 74, 0.04), var(--bg-card) 50%);
}

.payment-item.partial {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.04), var(--bg-card) 50%);
}

.payment-item.unpaid {
    border-left-color: var(--danger);
    background: linear-gradient(to right, rgba(220, 38, 38, 0.04), var(--bg-card) 50%);
}

.payment-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.payment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.payment-avatar.success {
    background: var(--success-bg);
    color: var(--success);
}

.payment-avatar.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.payment-info {
    min-width: 0;
}

.payment-name {
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-detail {
    margin-top: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    color: var(--success);
}

.status-badge.danger {
    color: var(--danger);
}

.status-badge i {
    width: 14px;
    height: 14px;
}

.payment-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-amount {
    font-size: 16px;
    font-weight: 700;
}

/* Toggle Button */
.toggle-payment {
    width: 50px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.toggle-track {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.3s;
}

.toggle-payment.active .toggle-track {
    background: var(--success);
}

.toggle-payment.active .toggle-thumb {
    left: 25px;
}

/* Residents */


.resident-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
}

.resident-item.inactive {
    opacity: 0.5;
}

.resident-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resident-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.resident-name {
    font-weight: 500;
    font-size: 15px;
}

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

.resident-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

.icon-btn.danger {
    color: var(--danger);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.fab i {
    width: 24px;
    height: 24px;
}

/* Form */
.form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--text);
}

.form-control::placeholder {
    color: var(--text-muted);
}

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

.form-actions {
    margin-top: 32px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-block {
    width: 100%;
    margin-bottom: 12px;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn:active {
    transform: scale(0.98);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Desktop Styles */
@media (min-width: 768px) {
    .app-header {
        left: 260px;
        padding: 0 20px;
    }

    .menu-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar {
        transform: translateX(0);
        width: 260px;
    }

    .close-sidebar {
        display: none;
    }

    .main-content {
        margin-left: 260px;
        padding-top: 56px;
    }

    .content {
        padding: 20px 20px;
        max-width: 100%;
        margin: 0 auto;
    }

    .stats-grid {
        gap: 20px;
    }

    .stat-card {
        padding: 24px;
    }

    .stat-value {
        font-size: 28px;
    }

    .payment-item {
        padding: 18px;
    }

    .form {
        max-width: 500px;
    }
}

@media (min-width: 1024px) {
    .content {
        padding: 40px 60px;
    }
}

@media (min-width: 1200px) {
    .content {
        padding: 40px 80px;
        max-width: 1100px;
    }
}

/* Theme Toggle Button - Modern Style */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-toggle i {
    width: 22px;
    height: 22px;
    transition: all 0.2s;
}

/* Dark theme: show moon, hide sun */
.theme-icon-light {
    display: none;
}

.theme-icon-dark {
    display: block;
    color: var(--text);
}

/* Settings Page - Centered */
.settings-container {
    max-width: 500px;
    margin: 0 auto;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}

.settings-card-header svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.settings-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
}

/* Light Theme */
body.light-theme {
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --bg-hover: #eeeeee;
    --text: #111111;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
}

/* Light theme: show sun, hide moon */
body.light-theme .theme-icon-light {
    display: block;
    color: var(--text);
}

body.light-theme .theme-icon-dark {
    display: none;
}

body.light-theme .sidebar-overlay {
    background: rgba(0, 0, 0, 0.3);
}

body.light-theme .toggle-thumb {
    background: #333;
}

body.light-theme .fab {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Action Row */
.action-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.action-row .search-wrapper {
    flex: 1;
    margin-bottom: 0;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

/* Print Header - Hidden by default */
.print-header {
    display: none;
}

/* Print Status - Hidden by default */
.print-status {
    display: none;
}

/* Payment Item Center & Inputs */
/* Payment Item Center & Inputs */
.payment-item {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(100px, 1.5fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(90px, 1.1fr) minmax(130px, 1.6fr) 50px;
    /* Strict columns */
    align-items: center;
    gap: 12px;
    /* Reduced gap */
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    /* Reduced padding */
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-left: 5px solid transparent;
    overflow: visible;
    /* Allow tooltips/shadows */
}

.payment-left {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Reduced gap */
    min-width: 0;
    width: 100%;
}

.payment-center {
    display: contents;
    /* flattened for grid */
}

/* Remove old flex center styles */
.payment-center>* {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.payment-right {
    display: contents;
}

/* Adjust alignments for grid cells */
.amount-group {
    align-items: flex-start;
}

.total-amount-group {
    align-items: flex-end;
    margin-right: 0;
}

.odenen-group {
    display: flex;
    align-items: center;
    gap: 4px;
    /* Reduced gap */
    justify-content: flex-end;
}


.amount-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Reduced gap */
}

.amount-group .label {
    font-size: 10px;
    /* Smaller label */
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.amount-group .value {
    font-weight: 700;
    font-size: 16px;
    /* Slightly smaller */
    color: var(--text);
}

.yakit-input,
.diger-input,
.odenen-input {
    width: 100%;
    /* Fluid width */
    min-width: 0;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    /* Softer radius */
    font-size: 15px;
    font-weight: 600;
    background: var(--bg-hover);
    /* Light background */
    color: var(--text);
    transition: all 0.2s;
}

.yakit-input:focus,
.diger-input:focus,
.odenen-input:focus {
    outline: none;
    border-color: var(--text);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.yakit-input.saved,
.diger-input.saved,
.odenen-input.saved {
    border-color: var(--success);
    background: var(--success-bg);
    color: var(--success);
}

.total-amount-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-right: 15px;
}

.total-amount-group .label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.total-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.print-only {
    display: none;
}

/* Partial Payment Styling */
.payment-item.partial {
    border-left: 4px solid #3b82f6;
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.print-status.info,
.payment-avatar.info {
    background: #3b82f6 !important;
    color: white !important;
}

/* Print Layout - Aligned & Clean */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: #000 !important;
    }

    .no-print,
    .sidebar,
    .sidebar-overlay,
    .app-header,
    .sidebar-footer,
    .toggle-payment,
    .status-badge,
    .month-selector,
    .filter-tabs,
    .search-wrapper,
    .yakit-input,
    .diger-input,
    .odenen-input,
    .payment-detail {
        display: none !important;
    }

    .print-header {
        display: block !important;
        text-align: left;
        /* Align title to left */
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #ddd;
    }

    @page {
        margin: 1cm;
        size: A4 portrait;
    }

    .print-header h1 {
        font-size: 20px;
        margin: 0;
    }

    .print-header p {
        font-size: 14px;
        margin: 0;
        color: #555;
    }

    .main-content,
    .content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .payment-list {
        display: block;
        width: 100%;
    }

    /* Restore Card Look */
    .payment-item {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        margin-bottom: 6px !important;
        page-break-inside: avoid !important;
        background: #fff !important;
        gap: 0 !important;
    }

    /* Left: Identity (30%) */
    .payment-left {
        width: 30% !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .payment-avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
        border: 1px solid #ccc;
        background: #f5f5f5 !important;
        color: #000 !important;
    }

    /* Center: Fees (45%) - Strictly Aligned */
    .payment-center {
        width: 45% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 0 !important;
    }

    .payment-center .amount-group {
        width: 33% !important;
        /* Fixed width for alignment */
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .amount-group .label {
        font-size: 9px !important;
        color: #666 !important;
        margin-bottom: 2px !important;
        text-transform: uppercase;
    }

    .amount-group .value,
    .yakit-print-value,
    .diger-print-value {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #000 !important;
        display: block !important;
    }

    .print-only {
        display: block !important;
    }

    /* Right: Total + Status (25%) */
    .payment-right {
        width: 25% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        justify-content: center !important;
        gap: 4px !important;
    }

    .total-amount-group {
        align-items: flex-end !important;
        margin: 0 !important;
    }

    .total-amount {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    /* Restore badges */
    .print-status {
        display: inline-block !important;
        padding: 2px 8px !important;
        border-radius: 4px !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #fff !important;
        margin-top: 2px !important;
        text-transform: uppercase !important;
    }

    .print-status.success {
        background: #16a34a !important;
        border: 1px solid #16a34a !important;
    }

    .print-status.danger {
        background: #dc2626 !important;
        border: 1px solid #dc2626 !important;
    }

    .print-status.info {
        background: #3b82f6 !important;
        border: 1px solid #3b82f6 !important;
    }

    .payment-name {
        font-size: 13px !important;
        font-weight: 600 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}

/* End Print */

/* Mobile Responsive Fixes - Ultra Compact & Professional */
@media screen and (max-width: 1200px) {
    .content {
        padding: 12px;
        padding-bottom: 90px;
    }

    .payment-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow: hidden;
        border-radius: 12px;
        border-left-width: 4px;
        grid-template-columns: none;
        /* Reset grid */
    }

    /* Header Section: Avatar + Name + Badge */
    .payment-left {
        width: 100%;
        padding: 12px 16px;
        background: var(--bg-hover);
        /* Slight contrast header */
        border-bottom: 1px solid var(--border);
    }

    .payment-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .payment-name {
        font-size: 14px;
        font-weight: 600;
    }

    .status-badge {
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 12px;
        background: var(--bg-card);
        /* Badge contrast */
    }

    /* Body Section: Grid Layout for Data */
    .payment-center {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        /* 3 columns for Aidat, Yakit, Diger */
        gap: 8px;
        /* Tighter gap */
        margin: 0;
        padding: 12px 16px;
        border: none;
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .payment-center>* {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .amount-group {
        width: 100%;
    }

    .amount-group .label {
        font-size: 10px;
        margin-bottom: 4px;
        white-space: nowrap;
        /* Prevent wrapping */
    }

    .amount-group .value {
        font-size: 14px;
        /* Slightly smaller */
    }

    .yakit-input,
    .diger-input,
    .odenen-input {
        width: 100%;
        max-width: 100%;
        height: 36px;
        font-size: 13px;
        /* Slightly smaller for mobile */
        padding: 6px 8px;
    }

    /* Footer Section: Totals & Action */
    .payment-right {
        display: flex;
        /* Reset contents */
        width: 100%;
        padding: 12px 16px;
        background: var(--bg-card);
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        /* Allow wrapping if needed */
        border-top: 1px solid var(--border);
    }

    .payment-right>* {
        display: flex;
        align-items: center;
        width: auto;
    }

    .total-amount-group {
        margin: 0;
        order: 1;
        flex: 1;
        align-items: flex-start;
    }

    .total-amount-group .label {
        font-size: 10px;
    }

    .total-amount {
        font-size: 18px;
    }

    .odenen-group {
        order: 3;
        /* Move to new line */
        width: 100%;
        margin-top: 8px;
    }

    .toggle-payment {
        order: 2;
        transform: scale(1.1);
        width: 50px !important;
        /* Force width */
        height: 28px !important;
        display: block !important;
        /* Visual fix */
        flex-shrink: 0;
    }

    .print-status {
        display: none !important;
    }
}