body {

    margin:0;
    font-family:
    "Microsoft JhengHei",
    sans-serif;

    background:#f5f6fa;

}



.app {

    display:flex;
    height:100vh;

}



/* 左側 */

.sidebar {


    width:240px;

    background:#1f2937;

    color:white;

    padding:25px;


}



.logo {

    margin-bottom:40px;

}



.menu {

    list-style:none;

    padding:0;

}



.menu li {


    padding:15px;

    margin-bottom:10px;

    border-radius:10px;

    cursor:pointer;

}



.menu li:hover {


    background:#374151;

}



/* 右側 */


.content {

    flex:1;

}



/* 上方 */


.topbar {


    background:white;

    padding:20px;

    box-shadow:
    0 2px 5px rgba(0,0,0,0.1);


}



/* 卡片區 */


.dashboard {


    display:grid;

    grid-template-columns:
    repeat(4,1fr);

    gap:20px;

    padding:25px;


}



.card-box {


    background:white;

    padding:25px;

    border-radius:15px;

    box-shadow:
    0 3px 10px rgba(0,0,0,0.08);


}



.card-box p {


    font-size:28px;

    font-weight:bold;


}



/* 最近交易 */


.transaction {


    background:white;

    margin:0 25px;

    padding:25px;

    border-radius:15px;


}.menu-link{
    color:white;
    text-decoration:none;
    display:block;
}

.menu-link:hover{
    color:white;
}
/* ===============================
   SmartBook 手機版響應式
   =============================== */

/* 平板以下 */
@media (max-width: 992px) {

    .sidebar {
        width: 200px;
        padding: 20px 15px;
    }

    .logo {
        font-size: 22px;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-box {
        padding: 20px;
    }

}


/* 手機版 */
@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    .app {
        display: block;
        height: auto;
        min-height: 100vh;
    }

    /* 左側選單改成上方選單 */
    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .logo {
        margin-bottom: 15px;
        text-align: center;
    }

    .menu {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }

    .menu li {
        flex: 0 0 auto;
        margin-bottom: 0;
        padding: 10px 14px;
    }

    .content {
        width: 100%;
    }

    .topbar {
        padding: 15px;
    }

    .topbar h3 {
        font-size: 22px;
        margin: 0;
    }

    /* Dashboard 卡片改成雙欄 */
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .card-box {
        padding: 16px;
        border-radius: 12px;
    }

    .card-box h5 {
        font-size: 15px;
    }

    .card-box p {
        font-size: 21px;
        margin-bottom: 0;
    }

    .transaction {
        margin: 0 15px;
        padding: 18px;
        overflow-x: auto;
    }

    /* 表單頁 */
    .container {
        max-width: 100%;
        margin-top: 20px !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .card {
        padding: 18px !important;
    }

    .form-control,
    .form-select {
        min-height: 46px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 90px;
    }

    .btn {
        min-height: 44px;
        font-size: 16px;
    }

    /* 表格可以左右滑動 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 900px;
    }

}


/* 小型手機 */
@media (max-width: 480px) {

    .dashboard {
        grid-template-columns: 1fr;
    }

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

    .menu li {
        padding: 9px 12px;
        font-size: 14px;
    }

    .transaction {
        margin: 0 10px;
        padding: 14px;
    }

    h2 {
        font-size: 24px;
    }

    h4 {
        font-size: 19px;
    }

}
/* ===============================
   SmartBook V4 Dashboard
   =============================== */

:root {
    --sb-primary: #2563eb;
    --sb-primary-dark: #1d4ed8;
    --sb-bg: #f4f7fb;
    --sb-surface: #ffffff;
    --sb-text: #172033;
    --sb-muted: #6b7280;
    --sb-border: #e5e7eb;
    --sb-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --sb-radius: 20px;
}

body {
    background: var(--sb-bg);
    color: var(--sb-text);
}

.sidebar {
    width: 260px;
    background:
        linear-gradient(
            180deg,
            #15213b 0%,
            #1e293b 100%
        );
    padding: 28px 20px;
}

.sidebar-header {
    margin-bottom: 34px;
}

.logo {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
}

.sidebar-subtitle {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.menu li {
    padding: 0;
    margin-bottom: 8px;
}

.menu li a {
    display: block;
    width: 100%;
    padding: 13px 15px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.2s ease;
}

.menu li a:hover,
.menu li.active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.content {
    min-width: 0;
    padding-bottom: 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 32px 34px 24px;
    box-shadow: none;
    background: transparent;
}

.page-label,
.panel-label {
    margin: 0 0 5px;
    color: var(--sb-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.topbar h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
}

.page-description {
    margin: 7px 0 0;
    color: var(--sb-muted);
}

.dashboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 0 34px 24px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 150px;
    padding: 24px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 25px;
}

.income-card .card-icon {
    background: #dcfce7;
}

.expense-card .card-icon {
    background: #fee2e2;
}

.advance-card .card-icon {
    background: #fef3c7;
}

.balance-card .card-icon {
    background: #dbeafe;
}

.summary-card h5 {
    margin: 0 0 8px;
    color: var(--sb-muted);
    font-size: 14px;
    font-weight: 700;
}

.summary-card p {
    margin: 0 0 5px;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.2;
}

.summary-card small {
    color: var(--sb-muted);
    font-size: 12px;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    gap: 20px;
    padding: 0 34px;
}

.dashboard-panel {
    margin: 0;
    padding: 24px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow);
}

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

.panel-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.panel-link {
    color: var(--sb-primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.panel-link:hover {
    color: var(--sb-primary-dark);
}

.empty-message {
    margin: 0;
    padding: 26px 12px;
    color: var(--sb-muted);
    text-align: center;
}

.btn-primary {
    background: var(--sb-primary);
    border-color: var(--sb-primary);
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--sb-primary-dark);
    border-color: var(--sb-primary-dark);
}

/* 平板 */
@media (max-width: 1100px) {

    .dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

/* 手機 */
@media (max-width: 768px) {

    .sidebar {
        width: 100%;
        padding: 16px;
    }

    .sidebar-header {
        margin-bottom: 15px;
        text-align: center;
    }

    .menu {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .menu li {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .menu li a {
        padding: 10px 13px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px 16px 18px;
    }

    .topbar h1 {
        font-size: 27px;
    }

    .topbar .btn {
        width: 100%;
    }

    .dashboard {
        grid-template-columns: 1fr;
        padding: 0 16px 18px;
    }

    .dashboard-sections {
        padding: 0 16px;
    }

    .summary-card {
        min-height: auto;
    }

    .summary-card p {
        font-size: 24px;
    }
}
/* ===============================
   預算卡片
   =============================== */

.budget-card .card-icon {
    background: #ede9fe;
}

.budget-card-content {
    min-width: 0;
}

#budgetStatus {
    margin-bottom: 7px;
    font-size: 15px;
    line-height: 1.7;
}

#budgetStatus strong {
    color: var(--sb-text);
}
/* ===============================
   快速新增交易
   =============================== */

.quick-entry-section {
    padding: 0 34px 20px;
}

.quick-entry-panel {
    background: var(--sb-surface);
}

#quickEntryMessage {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 768px) {

    .quick-entry-section {
        padding: 0 16px 18px;
    }

}
/* ===============================
   本月支出 Top 5
   =============================== */

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

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

.expense-rank-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.expense-rank-medal {
    flex: 0 0 auto;
    font-size: 20px;
}

.expense-rank-category {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-rank-amount {
    flex: 0 0 auto;
    color: var(--sb-text);
}
/* ===============================
   最近 7 天收支趨勢
   =============================== */

.trend-panel {
    grid-column: 1 / -1;
}

.trend-chart-container {
    position: relative;
    width: 100%;
    height: 360px;
}

@media (max-width: 768px) {

    .trend-chart-container {
        height: 280px;
    }

}

/* ===============================
   今日摘要
   =============================== */

.today-summary-item{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:14px 0;

    border-bottom:1px solid var(--sb-border);

}

.today-summary-item:last-child{

    border-bottom:none;

}

.today-summary-label{

    font-weight:700;

    color:var(--sb-muted);

}

.today-summary-value{

    font-size:18px;

    font-weight:800;

}

/* ===============================
   月曆記帳
   =============================== */

.calendar-panel {
    grid-column: 1 / -1;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#calendarTitle {
    min-width: 110px;
    text-align: center;
    font-size: 17px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    margin-bottom: 8px;
    color: var(--sb-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.calendar-weekdays div {
    padding: 8px 4px;
}

.calendar-grid {
    overflow: hidden;
    border-top: 1px solid var(--sb-border);
    border-left: 1px solid var(--sb-border);
    border-radius: 14px;
}

.calendar-day {
    min-height: 110px;
    padding: 10px;
    background: var(--sb-surface);
    border-right: 1px solid var(--sb-border);
    border-bottom: 1px solid var(--sb-border);
}

.calendar-day.empty {
    background: #f8fafc;
}

.calendar-day.today {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px var(--sb-primary);
}

.calendar-date-number {
    margin-bottom: 8px;
    font-weight: 800;
}

@media (max-width: 768px) {

    .calendar-controls {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-day {
        min-height: 78px;
        padding: 7px;
    }

    .calendar-date-number {
        font-size: 13px;
    }

}

/* ===============================
   月曆每日收支
   =============================== */

.calendar-day-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.35;
}

.calendar-income {
    color: #16a34a;
    font-weight: 700;
}

.calendar-expense {
    color: #dc2626;
    font-weight: 700;
}

.calendar-advance {
    color: #d97706;
    font-weight: 700;
}

@media (max-width: 768px) {

    .calendar-day-summary {
        font-size: 11px;
    }

}

