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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: #ffffff;
    min-height: 100vh;
    transition: opacity 0.3s ease;
}

.screen {
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Login Screen Styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container h1 {
    font-size: 3rem;
    color: #00ff88;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.subtitle {
    color: #aaa;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

#login-form, #register-form {
    background-color: #1a1a1a;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.1);
    width: 100%;
    max-width: 400px;
}

#login-form h2, #register-form h2 {
    color: #00ff88;
    margin-bottom: 20px;
    text-align: center;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #2a2a2a;
    border: 2px solid #333;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: #00ff88;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #00ff88;
    color: #000;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    position: relative;
}

button:hover {
    background-color: #00cc6f;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #666;
    cursor: not-allowed;
    transform: none;
}

button.loading {
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

.form-link {
    text-align: center;
    margin-top: 15px;
    color: #aaa;
}

.form-link a {
    color: #00ff88;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.message.error {
    background-color: #ff4444;
    color: #fff;
}

.message.success {
    background-color: #00ff88;
    color: #000;
}

/* Dashboard Styles */
header {
    background-color: #1a1a1a;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #00ff88;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #aaa;
}

.logout-btn {
    width: auto;
    padding: 8px 20px;
    background-color: #ff4444;
    color: #fff;
}

.logout-btn:hover {
    background-color: #cc0000;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 2px solid #2a2a2a;
    transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card .amount {
    font-size: 2rem;
    font-weight: bold;
}

.card-income {
    border-color: #00ff88;
}

.card-income .amount {
    color: #00ff88;
}

.card-expense {
    border-color: #ff4444;
}

.card-expense .amount {
    color: #ff4444;
}

.card-balance {
    border-color: #00ccff;
}

.card-balance .amount {
    color: #00ccff;
}

/* Transaction Form */
.transaction-form {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.transaction-form h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-checkbox {
    margin-bottom: 15px;
}

.form-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 1rem;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    margin: 0;
}

.form-checkbox span {
    user-select: none;
}

#installment-fields {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 3px solid #00ccff;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.installment-note {
    color: #00ccff;
    font-size: 0.85rem;
    margin-top: 10px;
    font-style: italic;
}

/* Transaction List */
.transaction-list {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.transaction-list h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

.transaction-item {
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #00ff88;
    transition: transform 0.2s;
}

.transaction-item:hover {
    transform: translateX(5px);
}

.transaction-item.expense {
    border-left-color: #ff4444;
}

.transaction-info {
    flex: 1;
}

.transaction-info .description {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.transaction-info .date {
    color: #aaa;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-recurring {
    background-color: #9b59b6;
    color: #fff;
}

.badge-category {
    background-color: #3498db;
    color: #fff;
}

.transaction-amount {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: right;
}

.transaction-amount.income {
    color: #00ff88;
}

.transaction-amount.expense {
    color: #ff4444;
}

.installment-info {
    font-size: 0.85rem;
    color: #00ccff;
    margin-bottom: 3px;
}

.installment-amount {
    font-size: 1.3rem;
    font-weight: bold;
}

.transaction-actions {
    margin-left: 15px;
    display: flex;
    gap: 10px;
}

.edit-btn {
    width: auto;
    padding: 8px 15px;
    background-color: #00ccff;
    color: #000;
    font-size: 0.9rem;
}

.edit-btn:hover {
    background-color: #00aacc;
}

.delete-btn {
    width: auto;
    padding: 8px 15px;
    background-color: #ff4444;
    color: #fff;
    font-size: 0.9rem;
}

.delete-btn:hover {
    background-color: #cc0000;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #aaa;
}

/* Transaction List Header with Filters */
.transaction-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters select {
    width: auto;
    min-width: 150px;
    padding: 8px 12px;
    margin-bottom: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.2);
    border: 2px solid #00ff88;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: #00ff88;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content p {
    color: #aaa;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

.btn-primary {
    background-color: #00ff88;
    color: #000;
}

.btn-primary:hover {
    background-color: #00cc6f;
}

.btn-secondary {
    background-color: #666;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-danger {
    background-color: #ff4444;
    color: #fff;
}

.btn-danger:hover {
    background-color: #cc0000;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #1a1a1a;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast-success {
    border-left: 4px solid #00ff88;
}

.toast-success .toast-icon {
    color: #00ff88;
}

.toast-error {
    border-left: 4px solid #ff4444;
}

.toast-error .toast-icon {
    color: #ff4444;
}

.toast-info {
    border-left: 4px solid #00ccff;
}

.toast-info .toast-icon {
    color: #00ccff;
}

/* Password visibility toggle */
.password-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.password-wrapper input {
    margin-bottom: 0;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 100%;
    padding: 0;
    background: transparent;
    color: #aaa;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    border-radius: 0 5px 5px 0;
}

.toggle-password:hover {
    background: transparent;
    color: #00ff88;
    transform: none;
}

/* Transaction list title row */
.transaction-list-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.transaction-list-title h2 {
    margin-bottom: 0;
}

.transaction-count {
    font-size: 0.85rem;
    color: #aaa;
    background-color: #2a2a2a;
    padding: 3px 10px;
    border-radius: 12px;
}

/* Search filter input */
.filter-search {
    width: auto;
    min-width: 200px;
    padding: 8px 12px;
    margin-bottom: 0;
    background-color: #2a2a2a;
    border: 2px solid #333;
    border-radius: 5px;
    color: #fff;
    font-size: 0.95rem;
}

.filter-search:focus {
    outline: none;
    border-color: #00ff88;
}

/* Export CSV button */
.btn-export {
    width: auto;
    padding: 8px 15px;
    background-color: #2a2a2a;
    color: #00ff88;
    border: 2px solid #00ff88;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-export:hover {
    background-color: #00ff88;
    color: #000;
}

/* Category breakdown section */
.category-breakdown {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.category-breakdown h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

.breakdown-period {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: normal;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.breakdown-label {
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-bar-wrap {
    background-color: #2a2a2a;
    border-radius: 4px;
    height: 14px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff7744);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.breakdown-value {
    font-size: 0.9rem;
    color: #ff4444;
    white-space: nowrap;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 1200px) {
    main {
        padding: 30px 15px;
    }
}

@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .transaction-list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters {
        width: 100%;
    }
    
    .filters select {
        flex: 1;
        min-width: 120px;
    }

    .filter-search {
        width: 100%;
        min-width: unset;
    }

    .btn-export {
        width: auto;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .transaction-amount {
        text-align: left;
        width: 100%;
    }
    
    .transaction-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .delete-btn,
    .edit-btn {
        width: 100%;
        flex: 1;
    }
    
    .transaction-info .description {
        font-size: 1rem;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    #toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .filter-search {
        width: 100%;
        min-width: unset;
    }

    .breakdown-row {
        grid-template-columns: 110px 1fr auto;
    }
}

@media (max-width: 480px) {
    .login-container h1 {
        font-size: 2.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card .amount {
        font-size: 1.5rem;
    }
}

/* Feedback Floating Button */
#feedback-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #00ff88;
    color: #000;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#feedback-floating-btn:hover {
    background-color: #00cc6f;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

#feedback-floating-btn:active {
    transform: translateY(0) scale(1);
}

/* Feedback Modal Textarea */
#feedback-message {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #2a2a2a;
    border: 2px solid #333;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#feedback-message:focus {
    outline: none;
    border-color: #00ff88;
}

@media (max-width: 768px) {
    #feedback-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* ====================================
   NAVIGATION TABS
   ==================================== */

.nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #2a2a2a;
}

.nav-tab {
    width: auto;
    padding: 12px 28px;
    background-color: transparent;
    color: #aaa;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
    transform: none;
}

.nav-tab:hover {
    color: #fff;
    background-color: transparent;
    transform: none;
}

.nav-tab.active {
    color: #00ff88;
    border-bottom-color: #00ff88;
    background-color: transparent;
}

.nav-tab.active:hover {
    background-color: transparent;
    transform: none;
}

/* ====================================
   DEBTOR SUMMARY CARDS
   ==================================== */

.card-debt-total {
    border-color: #ff9900;
}

.card-debt-total .amount {
    color: #ff9900;
}

.card-debt-paid {
    border-color: #00ff88;
}

.card-debt-paid .amount {
    color: #00ff88;
}

.card-debt-remaining {
    border-color: #ff4444;
}

.card-debt-remaining .amount {
    color: #ff4444;
}

/* ====================================
   DEBTOR LIST ITEMS
   ==================================== */

.debtor-item {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-left: 4px solid #ff9900;
    transition: transform 0.2s;
}

.debtor-item:hover {
    transform: translateX(5px);
}

.debtor-item.fully-paid {
    border-left-color: #00ff88;
    opacity: 0.8;
}

.debtor-info {
    flex: 1;
    min-width: 0;
}

.debtor-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #fff;
}

.debtor-reason {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 12px;
    font-style: italic;
}

/* Debt progress bar */
.debt-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.debt-progress-bar-wrap {
    flex: 1;
    background-color: #1a1a1a;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
}

.debt-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00cc6f, #00ff88);
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.debt-progress-bar.paid {
    background: linear-gradient(90deg, #00cc6f, #00ff88);
}

.debt-progress-text {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
}

/* Debtor amounts panel */
.debtor-amounts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    text-align: right;
}

.debtor-amount-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.95rem;
}

.amount-label {
    color: #aaa;
}

.amount-value {
    font-weight: bold;
    color: #fff;
}

.amount-value.paid {
    color: #00ff88;
}

.amount-value.remaining {
    color: #ff4444;
}

/* Debtor action buttons */
.debtor-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.pay-btn {
    width: auto;
    padding: 8px 15px;
    background-color: #ff9900;
    color: #000;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pay-btn:hover {
    background-color: #cc7a00;
}

/* Paid badge */
.badge-paid {
    background-color: #00ff88;
    color: #000;
}

/* Payment modal info paragraph */
.payment-modal-info {
    text-align: left !important;
    color: #aaa !important;
    font-size: 1rem !important;
    background-color: #2a2a2a;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px !important;
    line-height: 1.6;
}

.payment-remaining-value {
    color: #ff4444;
    font-weight: bold;
}

/* ====================================
   DEBTOR RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .debtor-item {
        flex-direction: column;
        gap: 15px;
    }

    .debtor-amounts {
        width: 100%;
        text-align: left;
    }

    .debtor-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
    }

    .debtor-actions button {
        flex: 1;
    }

    .nav-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}
