@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

:root {
    --color-primary: #4a80f0;
    --color-primary-dark: #3a63d9;
    --color-secondary: #1e293b;
    --color-accent: #f59e0b;
    --color-surface: #ffffff;
    --color-muted: #4b5563;
    --color-border: #e0e0e0;
    --color-background: #f7f8fc;
    --color-text-main: #333333;
    --shadow-sm: 0 8px 16px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
    --radius-md: 12px;
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--color-text-main);
    background-color: var(--color-background);
    line-height: 1.65;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.header-shadow,
.workspace-header {
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.workspace-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .workspace-header__inner {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.card-base {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
}

.btn,
button.btn {
    font-weight: 600;
    border-radius: 0.65rem;
    padding: 0.55rem 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus,
button.btn-primary:hover,
button.btn-primary:focus {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.btn-secondary,
button.btn-secondary {
    background-color: var(--color-secondary);
    border: none;
    color: #ffffff;
}

.btn-secondary:hover,
.btn-secondary:focus,
button.btn-secondary:hover,
button.btn-secondary:focus {
    background-color: #111827;
    color: #ffffff;
}

.btn-outline,
button.btn-outline,
.btn-outline-primary,
button.btn-outline-primary {
    background-color: transparent;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover,
.btn-outline:focus,
button.btn-outline:hover,
button.btn-outline:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
button.btn-outline-primary:hover,
button.btn-outline-primary:focus {
    background-color: var(--color-primary);
    color: #ffffff;
}

.input-base,
.select-base,
.form-control,
.form-select {
    border: 1px solid var(--color-border);
    border-radius: 0.65rem;
    padding: 0.55rem 0.85rem;
    background-color: var(--color-surface);
    color: var(--color-text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-base:focus,
.select-base:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 128, 240, 0.2);
    outline: none;
}

.selector-base,
select.selector-base,
select.form-control,
select {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: var(--color-surface);
    color: var(--color-text-main);
    padding: 6px 32px 6px 12px;
    font-size: 14px;
    height: 38px;
    line-height: 1.4;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.selector-base:hover,
select:hover {
    border-color: var(--color-primary);
}

select.selector-base:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(74, 128, 240, 0.2);
}

.modal-base .modal-content,
.modal .modal-content {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: none;
}

.modal-base .modal-header,
.modal .modal-header {
    border-bottom: 1px solid var(--color-border);
}

.modal-base .modal-footer,
.modal .modal-footer {
    border-top: 1px solid var(--color-border);
}

.table-scroll {
    overflow-x: auto;
    width: 100%;
}

.table-matrix {
    width: 100%;
    border-collapse: collapse;
    min-width: 1024px;
    table-layout: auto;
    background-color: var(--color-surface);
}

.table-matrix--lg {
    min-width: 1200px;
}

.table-matrix--xl {
    min-width: 1600px;
}

.table-matrix th,
.table-matrix td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    white-space: nowrap;
    vertical-align: middle;
    color: var(--color-secondary);
}

.table-matrix--dense th,
.table-matrix--dense td {
    padding: 0.5rem 0.75rem;
}

.table-matrix--numeric th,
.table-matrix--numeric td {
    text-align: right;
}

.table-matrix thead th {
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--color-secondary);
}

.table-matrix__col-account {
    text-align: left;
    min-width: 200px;
}

.table-matrix__col-account--wide {
    min-width: 260px;
}

.table-matrix__subhead {
    background-color: #eef2ff !important;
    text-align: center;
    font-weight: 600;
}

.table-matrix__col-level {
    width: 200px;
}

.table-matrix__col-month {
    width: 140px;
}

.table-matrix__actions {
    width: 120px;
}

.pl-comparison-table th,
.pl-comparison-table td {
    text-align: center;
}

.pl-comparison-table .table-matrix__col-account {
    text-align: center;
}

.pl-comparison-table .subtotal-row td {
    text-align: left !important;
    font-weight: 600;
}

.table-matrix td.indent-depth-0 { padding-left: 1rem; }
.table-matrix td.indent-depth-1 { padding-left: 2.5rem; }
.table-matrix td.indent-depth-2 { padding-left: 4rem; }
.table-matrix td.indent-depth-3 { padding-left: 5.5rem; }
.table-matrix td.indent-depth-4 { padding-left: 7rem; }
.table-matrix td.indent-depth-5,
.table-matrix td.indent-depth-6 { padding-left: 8.5rem; }

.responsive-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .responsive-filter-row {
        grid-auto-flow: column;
        grid-auto-columns: minmax(180px, auto);
    }
}

.header-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.header-filters > * {
    flex: 1 1 180px;
    min-width: 160px;
}

@media (max-width: 768px) {
    .header-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .header-filters > * {
        width: 100%;
        min-width: auto;
    }
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

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

.shadow-divider {
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
    .workspace-header__inner {
        padding: 1.25rem 1rem;
    }

    .btn,
    button.btn {
        width: 100%;
    }
}
