/* Grundlayout */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f6f6f3;
    color: #333;
    padding-bottom: 170px;
}

/* Header */
h1 {
    margin: 0;
    padding: 22px 10px;
    text-align: center;
    background: #41a56f;
    color: white;
    font-size: 1.55em;
    font-weight: bold;
}

h1 .title-accent {
    color: #81cf72;
}

.page-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #41a56f;
}

.page-header h1 {
    width: 100%;
    padding: 22px 72px;
    background: transparent;
}

.header-back {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: white;
    z-index: 1;
}

.header-back svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-back::before {
    content: none !important;
    display: none !important;
}

.header-back:active {
    transform: translateY(-50%) scale(0.92);
}

.header-back:not(:active) {
    transform: translateY(-50%);
}

/* Container */
.container {
    width: 100%;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.page-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Thin Card */
.container-thincard {
    display: flex;
}

.card-thin {
    width: 100%;
    min-height: 96px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-thin > div:first-child {
    flex: 1;
    text-align: left;
    padding-left: 10px;
}

.card-thin > div:nth-child(2) {
    flex: 2;
    text-align: center;
    font-weight: bold;
    font-size: 1.55em;
}

.card-thin > div:last-child {
    flex: 1;
    text-align: right;
    padding-right: 10px;
}

.card-thin button {
    background: none;
    border: 2px solid white;
    cursor: pointer;
    padding: 4px;
}

.card-thin svg {
    width: 46px;
    height: 46px;
}

.card-thin button:active {
    transform: scale(0.88);
}

/* Small Cards */
.container-smallcards {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.card-small {
    width: 100%;
    min-height: 116px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-small > div:first-child {
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.45em;
}

.card-small > div:last-child {
    text-transform: uppercase;
    font-size: 1.45em;
}

/* Medium Card */
.card-medium {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    min-height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.6em;
}

/* Large Card */
.card-large {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.card-large > div:first-child,
.card-large > div:nth-child(3) {
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.45em;
    padding: 24px 18px 18px;
    background: #f5f5f5;
    color: #444;
}

.card-large > div:nth-child(2) {
    padding-bottom: 20px;
}

.card-form,
.card-list,
.settings-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 18px;
    box-sizing: border-box;
}

.card-form h2,
.card-list h2,
.settings-list h2 {
    margin: 0 0 18px;
    text-transform: uppercase;
    font-size: 1.45em;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

label,
.field-label {
    font-size: 1.15em;
    font-weight: bold;
    color: #444;
}

input,
select {
    width: 100%;
    min-height: 56px;
    border: 1px solid #d8d8d2;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 1.1em;
}

input:focus,
select:focus {
    outline: 3px solid rgba(65,165,111,0.25);
    border-color: #41a56f;
}

.choice-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    flex-direction: column;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 16px;
    border: 1px solid #d8d8d2;
    border-radius: 8px;
    background: #fafafa;
    font-size: 1.05em;
    font-weight: bold;
}

.choice input {
    width: 28px;
    min-height: 28px;
    padding: 0;
}

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

.duration-detail-field {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.status {
    min-height: 40px;
    font-size: 1.1em;
    font-weight: bold;
    color: #389460;
}

.btn,
button {
    border: none;
    border-radius: 8px;
    background: #41a56f;
    color: white;
    min-height: 52px;
    padding: 14px 18px;
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

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

.btn-secondary {
    background: white;
    color: #389460;
    border: 2px solid #41a56f;
}

.btn-danger {
    background: #bd3f3f;
}

.btn-compact {
    padding: 10px 14px;
    font-size: 1.0em;
}

.button-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.settings-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.settings-links a {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    background: #f7fbf8;
    border: 1px solid #d8e9dd;
    color: #389460;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#latestExpenses,
#fixcostList {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.dashboard-list-item {
    padding: 14px 18px;
    border-top: 1px solid #ececec;
}

.dashboard-list-row {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 3px 0;
}

.dashboard-list-primary {
    padding-top: 0;
}

.dashboard-list-label {
    color: #606660;
    font-weight: bold;
    text-transform: uppercase;
}

.dashboard-list-value,
.dashboard-list-amount {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.dashboard-list-amount {
    font-weight: bold;
    color: #389460;
}

.dashboard-empty {
    margin-top: 5px;
    color: #606660;
    font-size: 0.92rem;
    line-height: 1.3;
}

.dashboard-empty {
    padding: 14px 18px 18px;
}

/* Dashboard Table */
.table-dashboard,
.table-app,
#entryTable,
#categoryTable,
#tableRecipient,
#tableDescription {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 1.0em;
    color: #444;
}

.table-dashboard thead th,
.table-app thead th,
#entryTable thead th,
#categoryTable thead th,
#tableRecipient thead th,
#tableDescription thead th {
    background: #f5f5f5;
    padding: 14px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-weight: bold;
}

.table-dashboard tbody tr:nth-child(even),
.table-app tbody tr:nth-child(even),
#entryTable tbody tr:nth-child(even),
#categoryTable tbody tr:nth-child(even),
#tableRecipient tbody tr:nth-child(even),
#tableDescription tbody tr:nth-child(even) {
    background: #fafafa;
}

.table-dashboard td,
.table-app td,
#entryTable td,
#categoryTable td,
#tableRecipient td,
#tableDescription td {
    padding: 20px;
    border-bottom: 1px solid #e6e6e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-dashboard td:last-child,
.table-dashboard td:nth-child(3) {
    text-align: right;
    font-weight: 600;
}

#entryTable select {
    min-height: 48px;
    font-size: 0.95em;
    padding: 6px 8px;
}

#entryTable {
    min-width: 1460px;
}

.ledger-card {
    padding: 0;
    overflow: hidden;
}

.ledger-card .table-wrap {
    margin: 0;
    width: 100%;
}

#entryTable tbody tr:last-child td {
    border-bottom: none;
}

#entryTable .col-date,
#entryTable .col-created {
    width: 210px;
}

#entryTable .col-recipient,
#entryTable .col-category {
    width: 180px;
}

#entryTable .col-amount,
#entryTable .col-type,
#entryTable .col-action {
    width: 130px;
}

#entryTable .col-description {
    width: 300px;
}

#entryTable thead tr:first-child th {
    align-items: center;
    gap: 8px;
    overflow: visible;
    white-space: nowrap;
}

#entryTable thead tr:first-child th:not(.no-sort) {
    display: table-cell;
}

#entryTable thead tr:first-child th .filter-toggle,
#entryTable thead tr:first-child th span {
    vertical-align: middle;
}

#entryTable thead tr:first-child th span {
    display: inline-block;
}

#entryTable .filter-toggle {
    position: relative;
    width: 34px;
    min-width: 34px;
    height: 32px;
    min-height: 32px;
    margin: 0 8px 0 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #d8d8d2;
    background: #fff;
    color: #606660;
}

#entryTable .filter-toggle::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    clip-path: polygon(8% 12%, 92% 12%, 60% 50%, 60% 86%, 40% 86%, 40% 50%);
}

#entryTable .filter-toggle.active {
    border-color: #41a56f;
    background: #e9f6ee;
    color: #389460;
}

#entryTable .filter-toggle.active::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #41a56f;
}

.filter-menu {
    position: fixed;
    z-index: 2500;
    width: min(280px, calc(100vw - 24px));
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #d8d8d2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.filter-menu-item {
    position: relative;
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    padding: 0 12px 0 36px;
    border-radius: 6px;
    background: transparent;
    color: #2f332f;
    font-size: 0.95rem;
    font-weight: normal;
    text-align: left;
}

.filter-menu-item::before {
    content: "";
    position: absolute;
    left: 12px;
    width: 14px;
    height: 14px;
    border: 1px solid #c9cec9;
    border-radius: 3px;
    background: #fff;
}

.filter-menu-item.selected {
    background: #e9f6ee;
    color: #389460;
    font-weight: bold;
}

.filter-menu-item.selected::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #41a56f;
    background: #41a56f;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
}

#entryTable button,
#categoryTable button,
#tableRecipient button,
#tableDescription button {
    padding: 10px 14px;
    font-size: 0.85em;
    margin: 3px;
}

#categoryTable input,
#tableRecipient input,
#tableDescription input {
    min-height: 48px;
    font-size: 0.9em;
}

/* Navbar */
.navbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 136px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
    overflow: visible;
    z-index: 1000;  /* wichtig! */
}

.nav-item {
    width: 104px;
    text-align: center;
    font-size: 1.0em;
    color: #4a4a4a;
}

.nav-item img {
    width: 58px;
    height: 58px;
    display: block;
    margin: 0 auto 5px;
}

/* FAB */
.fab-wrapper {
    position: relative;
    z-index: 1500;
}

.fab {
    position: absolute;
    top: -108px;
    left: 50%;
    transform: translateX(-50%);
    width: 112px;
    height: 112px;
    background: #41a56f;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5em;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 2000;
}

.fab:active {
    transform: translateX(-50%) scale(0.88);
}


/* FAB Options */
.fab-options {
    position: absolute;
    bottom: 128px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    flex-direction: row;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 2001;
}

.fab-options.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.fab-option {
    background: #41a56f;
    color: white;
    border: none;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    font-size: 1.0em;
    cursor: pointer;
}

.fab-option:active {
    transform: translateY(1px);
}

@media (min-width: 760px) {
    body {
        padding-bottom: 280px;
    }

    h1 {
        padding: 30px 0;
        font-size: 2.8em;
    }

    .container {
        padding: 20px;
        gap: 20px;
    }

    .card-thin {
        min-height: 140px;
    }

    .card-thin > div:nth-child(2) {
        font-size: 2.5em;
    }

    .card-thin svg {
        width: 60px;
        height: 60px;
    }

    .container-smallcards {
        flex-direction: row;
        gap: 20px;
    }

    .card-small {
        width: 32%;
        min-height: 200px;
    }

    .card-small > div:first-child,
    .card-small > div:last-child,
    .card-medium {
        font-size: 2.3em;
    }

    .card-medium {
        min-height: 200px;
    }

    .card-large > div:first-child,
    .card-large > div:nth-child(3),
    .card-form h2,
    .card-list h2,
    .settings-list h2 {
        font-size: 2.0em;
        padding: 20px;
    }

    .card-form,
    .card-list,
    .settings-list {
        padding: 28px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
    }

    label,
    .field-label {
        font-size: 1.45em;
    }

    input,
    select {
        min-height: 64px;
        font-size: 1.55em;
    }

    .choice-group {
        flex-direction: row;
    }

    .choice {
        min-height: 58px;
        font-size: 1.35em;
    }

    .status {
        font-size: 1.45em;
    }

    .btn,
    button {
        min-height: 60px;
        padding: 16px 24px;
        font-size: 1.35em;
    }

    .settings-links {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .settings-links a {
        min-height: 120px;
        font-size: 1.7em;
    }

    .table-dashboard,
    .table-app,
    #entryTable,
    #categoryTable,
    #tableRecipient,
    #tableDescription {
        min-width: 0;
        font-size: 1.8em;
    }

    .table-dashboard thead th,
    .table-app thead th,
    #entryTable thead th,
    #categoryTable thead th,
    #tableRecipient thead th,
    #tableDescription thead th,
    .table-dashboard td,
    .table-app td,
    #entryTable td,
    #categoryTable td,
    #tableRecipient td,
    #tableDescription td {
        padding: 20px;
    }

    .navbar {
        height: 240px;
    }

    .nav-item {
        width: 240px;
        font-size: 2.0em;
    }

    .nav-item img {
        width: 120px;
        height: 120px;
    }

    .fab {
        top: -200px;
        width: 200px;
        height: 200px;
        font-size: 6em;
    }

    .fab-options {
        bottom: 230px;
        gap: 40px;
    }

    .fab-option {
        min-height: 70px;
        padding: 20px 40px;
        font-size: 2.3em;
    }
}

/* Smartphone-App Design
   BudgetPilot ist aktuell primaer fuer Smartphone-Nutzung gedacht. */
* {
    box-sizing: border-box;
}

body {
    min-width: 0;
    padding-bottom: 108px;
    background: #f6f6f3;
    color: #2f332f;
    font-size: 16px;
}

h1 {
    padding: 20px 16px;
    font-size: 1.25rem;
    line-height: 1.2;
}

.container {
    max-width: none;
    width: 100%;
    padding: 16px;
    gap: 16px;
}

.page-actions {
    width: 100%;
}

.page-actions .btn,
.page-actions button {
    width: 100%;
    min-height: 58px;
    justify-content: flex-start;
    padding: 0 18px;
    font-size: 1.1rem;
}

.card-thin,
.card-small,
.card-medium,
.card-large,
.card-form,
.card-list,
.settings-list {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.card-thin {
    min-height: 96px;
}

.card-thin > div:nth-child(2) {
    font-size: 1.35rem;
}

.card-thin svg {
    width: 44px;
    height: 44px;
}

.container-smallcards {
    flex-direction: column;
    gap: 16px;
}

.card-small {
    min-height: 104px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    justify-content: stretch;
    padding: 16px 18px;
}

.card-small > div:first-child {
    font-size: 1rem;
    letter-spacing: 0;
    color: #606660;
}

.card-small > div:last-child {
    font-size: 1.1rem;
    font-weight: bold;
    color: #389460;
    text-align: right;
    white-space: nowrap;
}

.card-medium {
    min-height: 96px;
    padding: 18px;
    font-size: 1.35rem;
}

.card-large > div:first-child,
.card-large > div:nth-child(3),
.card-form h2,
.card-list h2,
.settings-list h2 {
    margin: 0;
    padding: 0 0 16px;
    font-size: 1.1rem;
    line-height: 1.25;
}

.card-large {
    padding-top: 0;
    overflow: hidden;
}

.card-large > div:first-child,
.card-large > div:nth-child(3) {
    padding-left: 18px;
    padding-right: 18px;
}

.card-form,
.card-list,
.settings-list {
    padding: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.field,
.field-full {
    min-width: 0;
}

label,
.field-label {
    font-size: 1rem;
    line-height: 1.2;
}

input,
select {
    min-height: 58px;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 1.05rem;
}

.choice-group {
    flex-direction: column;
    gap: 10px;
}

.choice {
    width: 100%;
    min-height: 58px;
    padding: 0 16px;
    font-size: 1.02rem;
}

.button-row {
    flex-direction: column;
    align-items: stretch;
}

.button-row button,
.card-form button[type="submit"] {
    width: 100%;
    min-height: 58px;
    font-size: 1.1rem;
}

.btn,
button {
    min-height: 52px;
    border-radius: 8px;
    padding: 0 18px;
    font-size: 1rem;
}

.status {
    min-height: 28px;
    font-size: 1rem;
}

.settings-list {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.settings-list h2 {
    padding: 0 2px 12px;
}

.settings-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-links a {
    min-height: 118px;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
    border: none;
    border-left: 6px solid #41a56f;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    color: #2f332f;
    text-align: left;
    font-size: 1rem;
}

.settings-link-title {
    display: block;
    color: #389460;
    font-size: 1.35rem;
    font-weight: bold;
    line-height: 1.2;
}

.settings-link-desc {
    display: block;
    margin-top: 8px;
    color: #606660;
    font-size: 1rem;
    line-height: 1.3;
}

.table-wrap,
#latestExpenses,
#fixcostList {
    margin-left: -18px;
    margin-right: -18px;
    width: calc(100% + 36px);
}

.table-dashboard,
.table-app,
#entryTable,
#categoryTable,
#tableRecipient,
#tableDescription {
    min-width: 680px;
    font-size: 0.95rem;
}

.table-dashboard thead th,
.table-app thead th,
#entryTable thead th,
#categoryTable thead th,
#tableRecipient thead th,
#tableDescription thead th,
.table-dashboard td,
.table-app td,
#entryTable td,
#categoryTable td,
#tableRecipient td,
#tableDescription td {
    padding: 14px;
}

#entryTable button,
#categoryTable button,
#tableRecipient button,
#tableDescription button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.95rem;
}

#entryTable select {
    min-height: 44px;
    font-size: 0.95rem;
}

.navbar {
    height: 86px;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    width: 96px;
    font-size: 0.82rem;
    font-weight: bold;
}

.nav-item img {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
}

.fab {
    top: -54px;
    width: 72px;
    height: 72px;
    font-size: 2.35rem;
}

.fab-options {
    bottom: 86px;
    gap: 10px;
}

.fab-option {
    min-height: 50px;
    padding: 0 16px;
    font-size: 1rem;
}

/* Ledger entries need a wider scroll table because the date headers are long. */
#entryTable {
    min-width: 1460px;
}

#entryTable .filter-toggle {
    width: 34px;
    min-width: 34px;
    height: 32px;
    min-height: 32px;
    margin: 0 8px 0 0;
    padding: 0;
}

.ledger-card {
    padding: 0;
    overflow: hidden;
}

.ledger-card .table-wrap {
    margin: 0;
    width: 100%;
}

#entryTable tbody tr:last-child td {
    border-bottom: none;
}

.fab {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    transition: transform 55ms ease-out, box-shadow 55ms ease-out;
}

.fab:focus,
.fab:focus-visible {
    outline: none;
}

.fab:active {
    transform: translateX(-50%) scale(0.94);
    box-shadow: 0 2px 7px rgba(0,0,0,0.22);
}

.dashboard-nav-press {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
    transition: transform 55ms ease-out;
}

.dashboard-nav-press:active,
.dashboard-nav-press.pressed {
    transform: scale(0.94);
}

#latestExpenses,
#fixcostList {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
}

#latestExpenses .dashboard-list,
#fixcostList .dashboard-list {
    min-width: 0;
}

@media (max-width: 360px) {
    .dashboard-list-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

.card-small {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    justify-content: stretch;
    padding: 16px 18px;
}

.card-small > div:first-child {
    color: #606660;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.card-small > div:last-child {
    color: #389460;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.card-thin {
    min-height: 76px;
}

.card-thin > div:first-child {
    padding-left: 6px;
}

.card-thin > div:nth-child(2) {
    font-size: 1.18rem;
}

.card-thin > div:last-child {
    padding-right: 6px;
}

.card-thin button {
    min-height: 50px;
    padding: 0;
}

.card-thin svg {
    width: 40px;
    height: 40px;
}

.card-small {
    min-height: 68px;
    padding: 14px 16px;
}

.card-large > div:first-child,
.card-large > div:nth-child(3) {
    padding: 18px;
    background: #f5f5f5;
    color: #444;
}

.header-back {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 0;
    background: transparent;
}

.header-back svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-back::before {
    content: none !important;
    display: none !important;
}

#tableRecipient,
#tableDescription {
    min-width: 0;
    table-layout: fixed;
    font-size: 0.86rem;
}

#tableRecipient .kw-col-id,
#tableDescription .kw-col-id {
    width: 36px;
}

#tableRecipient .kw-col-category,
#tableDescription .kw-col-category {
    width: 30%;
}

#tableRecipient .kw-col-keyword,
#tableDescription .kw-col-keyword {
    width: 34%;
}

#tableRecipient .kw-col-action,
#tableDescription .kw-col-action {
    width: 84px;
}

#tableRecipient thead th,
#tableDescription thead th,
#tableRecipient td,
#tableDescription td {
    padding: 9px 6px;
    height: 52px;
}

#tableRecipient th:first-child,
#tableDescription th:first-child,
#tableRecipient td:first-child,
#tableDescription td:first-child {
    padding-left: 12px;
}

#tableRecipient td,
#tableDescription td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

#tableRecipient .icon-btn,
#tableDescription .icon-btn,
#entryTable .icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
}

#tableRecipient .icon-btn svg,
#tableDescription .icon-btn svg,
#entryTable .icon-btn svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
    stroke: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#tableRecipient .icon-save svg,
#tableDescription .icon-save svg,
#entryTable .icon-save svg,
#tableRecipient .icon-cancel svg,
#tableDescription .icon-cancel svg,
#entryTable .icon-cancel svg {
    fill: none;
    stroke: currentColor;
}

#tableRecipient .kw-text input,
#tableDescription .kw-text input {
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 0.86rem;
}

#categoryTable {
    min-width: 0;
    table-layout: fixed;
    font-size: 0.86rem;
}

#categoryTable .cat-col-id {
    width: 42px;
}

#categoryTable .cat-col-action {
    width: 84px;
}

#categoryTable thead th,
#categoryTable td {
    height: 52px;
    padding: 9px 6px;
}

#categoryTable th:first-child,
#categoryTable td:first-child {
    padding-left: 12px;
}

#categoryTable td {
    white-space: normal;
    overflow-wrap: anywhere;
}

#categoryTable .icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
}

#categoryTable .icon-btn svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
    stroke: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#categoryTable .icon-save svg,
#categoryTable .icon-cancel svg {
    fill: none;
    stroke: currentColor;
}

#categoryTable .cat-name input {
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 0.86rem;
}

#entryTable .ledger-edit-input,
#entryTable .ledger-edit-select {
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 0.86rem;
}

#entryTable .ledger-edit-select {
    min-height: 34px;
}

#tableRecipient tbody tr:last-child td,
#tableDescription tbody tr:last-child td,
#categoryTable tbody tr:last-child td {
    border-bottom: none;
}

#tableRecipient,
#tableDescription {
    margin-bottom: 0;
}

.keyword-table-card {
    padding: 0;
    overflow: hidden;
}

.keyword-table-card h2 {
    margin: 0;
    padding: 18px;
    font-size: 1rem;
}

.keyword-table-card .table-wrap {
    margin: 0;
    width: 100%;
}

.keyword-create-toggle {
    display: flex;
    min-height: 64px;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 14px 18px;
    border: none;
    border-left: 6px solid #41a56f;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    color: #2f332f;
    text-align: left;
}

.keyword-create-toggle .settings-link-title {
    color: #389460;
    font-size: 1.05rem;
}

.keyword-create-toggle[hidden] {
    display: none;
}

.keyword-create-card h2 {
    font-size: 1rem;
}

h1.dashboard-title .title-base {
    color: #fff !important;
}

h1.dashboard-title .title-accent {
    color: #81cf72 !important;
}

h1.dashboard-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dashboard-header-logo {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

.dashboard-title .title-base,
.dashboard-title .title-accent {
    margin: 0;
}

.dashboard-title-word {
    display: inline-flex;
    align-items: flex-end;
    gap: 0;
    line-height: 1;
}

.dashboard-title .title-base,
.dashboard-title .title-accent {
    display: inline-block;
    line-height: 1;
}

.page-header h1 {
    padding-top: 20px;
    padding-bottom: 20px;
}

h1.dashboard-title,
.page-header {
    height: 64px;
    min-height: 64px;
}

h1.dashboard-title {
    padding-top: 0;
    padding-bottom: 0;
}

.page-header h1 {
    height: 64px;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
