* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
background: #f3f4f6;
color: #111827;
padding: 24px;
}
.page {
max-width: 960px;
margin: 0 auto;
background: #ffffff;
border-radius: 10px;
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
padding: 24px 24px 32px;
}
.page-header {
display: flex;
flex-direction: column;
gap: 12px;
margin-bottom: 24px;
}
.company-bar,
.client-bar {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.company-select-group,
.client-select-group {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: #4b5563;
}
.company-select-group label,
.client-select-group label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
}
.company-select,
.client-select {
min-width: 180px;
border-radius: 999px;
border: 1px solid #d1d5db;
padding: 6px 10px;
font-size: 13px;
background: #f9fafb;
color: #111827;
}
.company-select:focus,
.client-select:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
background: #ffffff;
}
.brand {
display: flex;
align-items: center;
gap: 12px;
}
.brand-logo-wrapper {
width: 56px;
height: 56px;
border-radius: 14px;
border: 1px solid #e5e7eb;
background: #f9fafb;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.brand-logo {
max-width: 100%;
max-height: 100%;
object-fit: cover;
display: none;
}
.brand-text {
display: flex;
flex-direction: column;
gap: 4px;
}
.brand-title {
font-size: 24px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #111827;
}
.brand-subtitle {
font-size: 12px;
color: #6b7280;
}
.invoice-meta {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 16px;
font-size: 13px;
}
.invoice-meta label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.06em;
color: #6b7280;
}
.invoice-meta input,
.invoice-meta select {
width: 100%;
border-radius: 6px;
border: 1px solid #e5e7eb;
padding: 6px 8px;
font-size: 13px;
color: #111827;
background: #f9fafb;
}
.invoice-meta input:focus,
.invoice-meta select:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
background: #ffffff;
}
.section {
margin-bottom: 20px;
}
.section-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: #6b7280;
margin-bottom: 8px;
}
.parties {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 16px;
}
.field-label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
margin-bottom: 4px;
}
.parties button.btn {
    margin-bottom: 6px;
}
.textarea,
.input {
width: 100%;
border-radius: 8px;
border: 1px solid #e5e7eb;
padding: 8px 10px;
font-size: 13px;
background: #f9fafb;
color: #111827;
}
.textarea {
min-height: 96px;
resize: vertical;
}
.textarea:focus,
.input:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
background: #ffffff;
}
.table-wrapper {
border-radius: 12px;
overflow: hidden;
border: 1px solid #e5e7eb;
background: #f9fafb;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
thead {
background: #f3f4f6;
}
th,
td {
padding: 8px 10px;
border-bottom: 1px solid #e5e7eb;
vertical-align: middle;
}
th {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
text-align: left;
}
td:last-child,
th:last-child {
text-align: right;
}
tr:last-child td {
border-bottom: none;
}
.item-desc-input {
width: 100%;
border-radius: 6px;
border: 1px solid #e5e7eb;
padding: 6px 8px;
font-size: 13px;
background: #ffffff;
}
.item-number-input {
width: 100%;
border-radius: 6px;
border: 1px solid #e5e7eb;
padding: 6px 8px;
font-size: 13px;
text-align: right;
background: #ffffff;
}
.item-desc-input:focus,
.item-number-input:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
}
.item-amount {
font-variant-numeric: tabular-nums;
color: #111827;
}
.item-delete-button {
border: none;
background: transparent;
color: #9ca3af;
cursor: pointer;
padding: 0 4px;
font-size: 14px;
}
.item-delete-button:hover {
color: #ef4444;
}
.invoices-modal-body {
display: grid;
grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
gap: 16px;
}
.invoices-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.invoices-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.invoices-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
background: #f9fafb;
border-radius: 10px;
overflow: hidden;
border: 1px solid #e5e7eb;
}
.invoices-table th,
.invoices-table td {
padding: 6px 8px;
border-bottom: 1px solid #e5e7eb;
white-space: nowrap;
}
.invoices-table th {
background: #f3f4f6;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
text-align: left;
position: sticky;
top: 0;
z-index: 2;
}
.invoices-table th:first-child,
.invoices-table td:first-child {
position: sticky;
left: 0;
z-index: 3;
background: #f3f4f6;
}
.invoices-table tbody td:first-child {
background: #f9fafb;
}
.invoices-table tr:last-child td {
border-bottom: none;
}
.invoices-row {
cursor: pointer;
}
.invoices-row:hover {
background: #e5f2ff;
}
.invoices-row.is-active {
background: #dbeafe;
}
.invoices-detail {
border-radius: 10px;
border: 1px solid #e5e7eb;
background: #f9fafb;
padding: 10px 12px;
font-size: 13px;
display: flex;
flex-direction: column;
gap: 6px;
}
.invoices-empty {
font-size: 12px;
color: #6b7280;
}
.invoice-detail-header {
display: flex;
justify-content: space-between;
font-weight: 600;
margin-bottom: 4px;
}
.invoice-detail-section-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
margin-top: 6px;
}
.invoice-detail-items {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 12px;
}
.items-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0 0;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
border-radius: 999px;
border: 1px solid transparent;
padding: 7px 14px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
user-select: none;
}
.btn-primary {
background: #111827;
color: #f9fafb;
}
.btn-primary:hover {
background: #020617;
transform: translateY(-1px);
}
.btn-outline {
background: transparent;
color: #111827;
border-color: #d1d5db;
}
.btn-outline:hover {
background: #f3f4f6;
}
.btn-ghost {
background: transparent;
color: #4b5563;
}
.btn-ghost:hover {
background: #f3f4f6;
}
.btn-small {
padding: 5px 10px;
font-size: 12px;
}
.is-hidden {
display: none !important;
}
.totals-notes-row {
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
gap: 20px;
align-items: flex-start;
}
.notes-box {
border-radius: 10px;
border: 1px dashed #d1d5db;
padding: 10px 12px;
background: #f9fafb;
}
.notes-box textarea {
width: 100%;
border: none;
background: transparent;
font-size: 13px;
resize: vertical;
min-height: 80px;
color: #111827;
}
.notes-box textarea:focus {
outline: none;
}
.totals-box {
border-radius: 10px;
border: 1px solid #e5e7eb;
padding: 10px 12px;
background: #f9fafb;
display: flex;
flex-direction: column;
gap: 6px;
}
.total-row {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 13px;
}
.total-label {
color: #4b5563;
}
.total-value {
font-variant-numeric: tabular-nums;
}
.total-input-wrapper {
display: flex;
align-items: center;
gap: 6px;
}
.total-input {
width: 80px;
border-radius: 999px;
border: 1px solid #d1d5db;
padding: 4px 8px;
font-size: 12px;
text-align: right;
background: #ffffff;
}
.total-input:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
}
.total-main {
font-size: 20px;
font-weight: 600;
color: #111827;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24px;
gap: 12px;
flex-wrap: wrap;
}
.toolbar-left,
.toolbar-right {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.badge {
display: inline-flex;
align-items: center;
gap: 6px;
border-radius: 999px;
border: 1px solid #d1d5db;
padding: 4px 8px;
font-size: 11px;
color: #4b5563;
background: #f9fafb;
}
.badge-dot {
width: 6px;
height: 6px;
border-radius: 999px;
background: #22c55e;
}
.company-dialog,
.client-dialog {
border: none;
padding: 0;
background: transparent;
}
.company-dialog[open],
.client-dialog[open] {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0;
padding: 0;
}
.company-dialog::backdrop,
.client-dialog::backdrop {
background: rgba(15, 23, 42, 0.45);
backdrop-filter: blur(2px);
}
.modal-panel {
width: 90vw;
max-width: 720px;
max-height: 90vh;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
padding: 18px 20px 16px;
display: flex;
flex-direction: column;
box-sizing: border-box;
}

#confirm-dialog .modal-panel {
width: min(360px, 90vw);
max-width: 360px;
max-height: min(70vh, 360px);
}

@media (max-width: 480px) {
    #company-dialog .modal-panel,
    #client-dialog .modal-panel,
    #invoices-dialog .modal-panel {
        border-radius: 0;
    }
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.modal-header-actions {
display: flex;
align-items: center;
gap: 6px;
}
.modal-title {
font-size: 16px;
font-weight: 600;
color: #111827;
}
.modal-body {
display: flex;
flex-direction: column;
gap: 12px;
margin-bottom: 12px;
flex: 1;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
}
.modal-footer {
display: flex;
justify-content: space-between;
gap: 8px;
}
#confirm-dialog .modal-footer {
justify-content: flex-end;
gap: 8px;
}
.confirm-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
}
.confirm-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b91c1c;
    flex-shrink: 0;
}
.confirm-icon i {
    font-size: 18px;
}
.confirm-message {
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}
.confirm-subtitle {
    font-size: 12px;
    color: #6b7280;
}
.confirm-list {
    margin: 12px 0 10px;
    padding-left: 22px;
}
.confirm-list li {
    margin: 6px 0;
    line-height: 1.6;
}
.confirm-field {
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 4px;
}
.company-list-select {
width: 100%;
border-radius: 8px;
border: 1px solid #d1d5db;
padding: 6px 8px;
font-size: 13px;
background: #f9fafb;
color: #111827;
}
.company-form-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 12px;
align-items: flex-start;
}
.client-dialog .company-form-grid {
grid-template-columns: minmax(0, 1fr);
}
.company-form-field {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
}
.company-form-field label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #6b7280;
}
.company-form-field input,
.company-form-field textarea {
border-radius: 8px;
border: 1px solid #e5e7eb;
padding: 6px 8px;
font-size: 13px;
background: #f9fafb;
color: #111827;
}
.company-form-field textarea {
resize: vertical;
min-height: 70px;
}
.company-form-field input:focus,
.company-form-field textarea:focus {
outline: 2px solid #3b82f6;
outline-offset: 1px;
border-color: #3b82f6;
background: #ffffff;
}
.company-logo-upload {
display: flex;
flex-direction: column;
gap: 8px;
}
.company-logo-preview {
    width: 100%;
    max-width: 100%;
    height: 100px;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.company-logo-preview img {
max-width: 100%;
max-height: 100%;
object-fit: cover;
}

.company-logo-upload input[type="file"] {
    width: 100%;
}

@media (max-width: 768px) {
    .company-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.management-body {
flex: 1;
min-height: 0;
}

.management-layout {
display: grid;
grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
gap: 16px;
height: 100%;
}

.management-list,
.management-form {
    min-height: 0;
}

.management-list {
    display: flex;
    flex-direction: column;
}

.management-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.management-form {
    overflow-y: auto;
    overflow-x: hidden;
}

.company-dialog.mode-list .management-form,
.client-dialog.mode-list .management-form {
display: none;
}

.company-dialog.mode-list .management-layout,
.client-dialog.mode-list .management-layout {
grid-template-columns: minmax(0, 1fr);
}

.company-dialog.mode-form .management-list,
.client-dialog.mode-form .management-list {
display: none;
}

.company-dialog.mode-form .management-layout,
.client-dialog.mode-form .management-layout {
grid-template-columns: minmax(0, 1fr);
}

.management-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #f9fafb;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    table-layout: auto;
}

.management-table th,
.management-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.management-empty {
    display: none;
    padding: 16px 12px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    margin-bottom: 8px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.management-empty i {
    font-size: 22px;
    margin-bottom: 4px;
    color: #9ca3af;
}
.management-empty-title {
    font-weight: 500;
}
.management-empty-subtitle {
    font-size: 12px;
}

.management-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.management-filter input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-size: 13px;
}
.management-filter-clear {
    min-width: auto;
    padding-inline: 8px;
}

.management-table th {
    background: #f3f4f6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
}

.management-table th:first-child,
.management-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f3f4f6;
}

.management-table tbody td:first-child {
    background: #f9fafb;
}

.management-table tr:last-child td {
border-bottom: none;
}

.management-row {
cursor: pointer;
}

.management-row:hover {
background: #e5f2ff;
}

.management-row.is-active {
background: #dbeafe;
}

@media (max-width: 768px) {
body {
padding: 12px;
}
.page {
padding: 16px;
}
.page-header {
flex-direction: column;
align-items: flex-start;
}
.invoice-meta {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.parties {
grid-template-columns: minmax(0, 1fr);
}
.totals-notes-row {
grid-template-columns: minmax(0, 1fr);
}
.toolbar {
flex-direction: column;
align-items: stretch;
}
.toolbar-left {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.toolbar-left .btn {
width: 100%;
justify-content: center;
}
.toolbar-right {
justify-content: flex-start;
}
}
