/* CSS Variables Definition */
:root {
    --bg-main: #F8F9FB;
    --bg-card: #FFFFFF;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --text-primary: rgb(26, 29, 33);
    --text-muted: rgb(107, 114, 128);
    --text-nav-muted: #7E7280;
    --text-dark: #1F2937;
    --text-black: #000000;
    
    /* Brand & Accent Colors */
    --primary-blue: #2563EB;
    --primary-blue-dark: #1D4ED8;
    --primary-blue-hover: #1E40AF;
    --bg-blue-light: #DBEAFE;
    
    /* Financial Coding Colors (Income/Expense/etc.) */
    --income-green: #166534;
    --income-bg: #DCFCE7;
    --income-dark: #0f5132;
    
    --expense-red: #991B1B;
    --expense-bg: #FEE2E2;
    --expense-dark: #842029;
    --expense-hover: #B91C1C;
    --expense-action: #DC2626;
    
    /* Utilities */
    --toggle-bg: #cbd5e1;
    --border-input: #CCCCCC;
    --bg-input: #F9FAFB;
    --btn-reset-bg: #fff5f5;
    --btn-reset-border: #fed7d7;
    --btn-reset-hover: #fee2e2;
    --grid-line: #f1f5f9;
}

/* Jab body par .dark-mode class aayegi, tab ye colors active honge */

/* Jab body par dark class aayegi tab ye colors chalenge */
body.dark {
    --bg-main: #111827;
    --bg-card: #1F2937;
    --border-color: #374151;
    --border-light: #374151;
    --text-primary: #F9FAFB;
    --text-muted: #9CA3AF;
    --text-nav-muted: #9CA3AF;
    --text-dark: #F3F4F6;
    --text-black: #FFFFFF;
    --bg-input: #111827;
    --grid-line: #374151;
}

@font-face {
    font-family: inter;
    src: url(UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inter;
}

html,
body {
    width: 100%;
    height: 100%;
}

/* Auth Screen Utility Styles */
.hidden {
    display: none !important;
}

.auth-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-main);
}

.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.auth-box h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-blue);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--text-black);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.container{
    width: 100%;
    min-height: 100vh;
    display: flex;
    background-color: var(--bg-main);
}

.sidebar{
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 0;
    flex-direction: column;
    background-color: var(--bg-card);
    width: 17%; 
    height: 100vh;
    border-right: 1px solid var(--border-color);
    padding: 23px 25px;
}

.sidebar-top{
    display: flex;
    gap: 12px;
}

.logo-icon{
    padding-top: 5px;
    font-size: 28px;
    line-height: 28px;
    font-weight: 900;
    color: var(--text-primary);
}

.logo :nth-child(1){
    font-size: 18px;
    line-height: normal;
    font-weight: 700;
    color: var(--text-primary);
}
.logo :nth-child(2){
    font-size: 12px;
    line-height: normal;
    font-weight: 400;
    color: var(--text-primary);
}

.sidebar-center{
    padding-bottom: 27rem;
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.dashboard{
    width: 210px;
    height: 43px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 15px;
    gap: 7px;
    font-size: 16px;
    line-height: normal;
    font-weight: 500;
    color: var(--text-nav-muted);
}

.dashboard:hover{
    background-color: var(--bg-blue-light);
    color: var(--primary-blue-hover);
}

.dashboard i{
    font-size: 17px;
    line-height: 16px;
    font-weight: 900;
}

.setting{
    width: 210px;
    height: 43px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 15px;
    gap: 7px;
    font-size: 16px;
    line-height: normal;
    font-weight: 500;
    color: var(--text-nav-muted);
}

.setting:hover{
    background-color: var(--bg-blue-light);
    color: var(--primary-blue-hover);
}

.setting i{
    font-size: 18px;
    line-height: 16px;
    font-weight: 900;
}


/* SETTINGS PAGE */
#settings-view {
    padding: 40px;
    width: 100%;
    max-width: 980px;
    margin: 0 auto; /* Yeh left aur right se center karega */
    box-sizing: border-box;
}

/* Purani #settings-view.hidden ko hata kar, pure project ke liye yeh likhein */
.hidden {
    display: none !important;
}

/* Card ko hamesha poori width (980px tak) par center rakhne ke liye */
.settings-card {
    background: var(--bg-card, #fff);
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
}


.settings-card{
    background:#fff;
    border:1px solid #E5E7EB;
    border-radius:16px;
    padding:28px;
    width:100%;
    max-width:980px;
}

body.dark .settings-card{
    background:var(--bg-card);
}

.settings-card h2{
    font-size:20px;
    margin-bottom:25px;
    color:var(--text-primary);
}

.settings-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-bottom:30px;
}

.settings-group{
    display:flex;
    flex-direction:column;
}

.settings-group label{
    font-size:15px;
    font-weight:600;
    margin-bottom:8px;
    color:var(--text-primary);
}

.settings-group input,
.settings-group select{

    height:46px;
    padding:0 15px;

    border:1px solid #D1D5DB;
    border-radius:8px;

    background:var(--bg-input);

    color:var(--text-primary);

    font-size:15px;
}

.settings-group input:focus,
.settings-group select:focus{

    outline:none;
    border-color:#2563EB;

}

.save-btn{

    background:#000;
    color:#fff;

    border:none;
    border-radius:8px;

    padding:13px 28px;

    cursor:pointer;

    font-size:15px;
    font-weight:600;
}

.save-btn:hover{
    opacity:.9;
}



.add-trans{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    line-height: normal;
    font-weight: 600;
    color: var(--bg-card);
    background-color: var(--text-black);
    width: 210px;
    height: 43px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.add-trans i{
    font-size: 12px;
}

.main-content{
    width: 83%;
    min-height: 100vh;
}

.navbar{
    width: 100%;
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 45px;
}

.right-nav{
    display: flex;
    align-items: center;
    gap: 35px;
}

.line-name{
    display: flex;
    align-items: center;
    gap: 18px;
}

.verticle-line{
    width: 1px;
    height: 16px;
    background-color: var(--border-color);
}

.name{
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    
}

.log{
    padding: 6px 16px;
    border: 1px solid var(--border-input);
    border-radius: 5px;
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    gap: 5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.log i{
    font-size: 16px;
    font-weight: 700;
}

/* DASHBOARD BODY */
.dashboard-body {
    padding: 40px;
}

.welcome-section {
    margin-bottom: 30px;
}

.main-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sub-title {
    color: var(--text-muted);
    font-size: 14px;
}

/* CARDS GRID */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.bg-blue { background-color: var(--bg-blue-light); }
.bg-green { background-color: var(--income-bg); }
.bg-red { background-color: var(--expense-bg); }
.bg-purple { background-color: var(--bg-blue-light); }

.card-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.color-green { color: var(--income-green); }
.color-red { color: var(--expense-red); }

/* LOWER GRID (CHART & PREFERENCES) */
.lower-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: flex-start;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chart-container, .preferences-container {
    display: flex;
    flex-direction: column;
}

.chart-box, .pref-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    flex-grow: 1;
}

/* CUSTOM BAR CHART GRAPHICS */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-color {
    width: 30px;
    height: 12px;
    border-radius: 2px;
}
.bg-dark-green { background-color: var(--income-dark); }
.bg-dark-red { background-color: var(--expense-dark); }

.visual-chart {
    display: flex;
    height: 240px;
    position: relative;
}

.y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
    padding-right: 12px;
    font-size: 11px;
    color: var(--text-muted);
    width: 50px;
}

.chart-bars-area {
    flex-grow: 1;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.grid-lines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.grid-lines div {
    border-top: 1px solid var(--grid-line);
    width: 100%;
    height: 0;
}

.bars-container {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    z-index: 2;
}

.bar {
    width: 140px;
    border-radius: 4px 4px 0 0;
}
.bar-income { background-color: var(--income-dark); }
.bar-expense { background-color: var(--expense-dark); }

.chart-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* PREFERENCES STYLES */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--grid-line);
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* TOGGLE SWITCH CUSTOMIZATION */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--toggle-bg);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: var(--bg-card);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-blue-hover); }
input:checked + .slider:before { transform: translateX(20px); }

/* RESET BUTTON */
.btn-reset {
    width: 100%;
    background-color: var(--btn-reset-bg);
    color: var(--expense-hover);
    border: 1px solid var(--btn-reset-border);
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-reset:hover {
    background-color: var(--btn-reset-hover);
}

/* ==========================================
   ALL TRANSACTIONS STYLES
   ========================================== */

.transactions-container {
    margin-top: 30px;
    width: 65.5%;
}

.transactions-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.transactions-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.transactions-filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 18px;
}

.search-wrapper input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-input);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    width: 270px;
    color: var(--text-dark);
}

.search-wrapper input::placeholder {
    color: var(--text-muted);
}

.type-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    cursor: pointer;
    min-width: 440px;
}

/* Table Design */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.transactions-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.05em;
}

.transactions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.bold-text {
    font-weight: 700;
    color: var(--text-black);
}

/* Category Chips */
.category-chip {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    display: inline-block;
}

.bg-gray {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* Amounts Color coding */
.amount {
    font-weight: 700;
}

.text-red {
    color: var(--expense-red);
}

.text-green {
    color: var(--income-green);
}

/* Actions Style */
.actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.2s;
}

.edit-btn {
    color: var(--primary-blue);
}

.edit-btn:hover {
    color: var(--primary-blue-dark);
}

.delete-btn {
    color: var(--expense-action);
}

.delete-btn:hover {
    color: var(--expense-hover);
}


/* Modal Overlay Background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6); /* Blurry/dark background screen */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

/* Modal Main Container Box */
.modal-box {
    background-color: #1e2640; /* Dark blue background matching screenshot */
    border: 1px solid #2d3748;
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

/* Header Section */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ffffff;
}

/* Input Fields Styles */
.modal-input-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-row {
    display: flex;
    gap: 16px;
}

.modal-row .modal-input-group {
    flex: 1;
}

.modal-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e0;
}

.modal-input-group input, 
.modal-input-group select {
    background-color: #141a30; /* Inner input dark fields */
    border: 1px solid #2d3748;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.modal-input-group input:focus, 
.modal-input-group select:focus {
    border-color: #3182ce;
}

/* Submit Button */
.submit-trans-btn {
    width: 100%;
    padding: 12px;
    background-color: #ffffff; /* White button from screenshot */
    color: #141a30;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.submit-trans-btn:hover {
    opacity: 0.9;
}