@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Cinzel:wght@600;700;800&display=swap');

:root {
    color-scheme: light;
    --color-primary: #2c3e50;
    --color-primary-dark: #1a252f;
    --color-secondary: #8b7355;
    --color-accent: #c9a26b;
    --color-surface: #fdfcfb;
    --color-background: #f5f3f0;
    --color-muted: #a0988a;
    --color-text: #2d3436;
    --color-text-secondary: #636e72;
    --color-border: #dcd7d0;
    --color-success: #27ae60;
    --color-error: #e74c3c;
    --color-warning: #f39c12;
    --shadow-sm: 0 2px 8px rgba(45, 52, 54, 0.08);
    --shadow-md: 0 4px 20px rgba(45, 52, 54, 0.12);
    --shadow-lg: 0 8px 32px rgba(45, 52, 54, 0.18);
    --sidebar-width: 280px;
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Cormorant Garamond", "Libre Baskerville", Georgia, serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    color: var(--color-text);
}

body {
    font-size: 17px;
    line-height: 1.7;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.app--locked {
    display: none;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.85), rgba(26, 37, 47, 0.82));
    z-index: 60;
    padding: 32px;
}

.auth-card {
    width: min(460px, 94vw);
    background: var(--color-surface);
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.auth-card__header h1 {
    font-size: 30px;
    margin-bottom: 10px;
    color: var(--color-primary);
}

.auth-card__header p {
    font-family: "Inter", sans-serif;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-demo-credentials {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(201, 162, 107, 0.12);
    border: 1px solid rgba(201, 162, 107, 0.3);
    border-radius: 10px;
    font-family: "Inter", sans-serif;
    color: var(--color-text);
}

.auth-demo-credentials .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.credential-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.credential-pills .credential {
    background: #fff;
    border: 1px solid rgba(201, 162, 107, 0.4);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.credential-pills .credential strong {
    letter-spacing: 0.08em;
}

.auth-form__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form__group label {
    font-family: "Inter", sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.auth-form__group input {
    border-radius: 8px;
    border: 2px solid var(--color-border);
    padding: 14px 16px;
    font-family: "Inter", sans-serif;
    font-size: 15px;
    transition: all var(--transition-base);
}

.auth-form__group input:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(201, 162, 107, 0.15);
}

.auth__message {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--color-text-secondary);
    min-height: 20px;
}

.auth__message--error {
    color: var(--color-error);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    font-family: "Playfair Display", "Cormorant Garamond", Georgia, serif;
    letter-spacing: 0.02em;
}

p {
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    color: #fdfcfb;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    position: relative;
    z-index: 3;
    transition: transform var(--transition-base);
    border-right: 1px solid rgba(201, 162, 107, 0.15);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    border-radius: 0 28px 28px 0;
    overflow: hidden;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(201, 162, 107, 0.2);
}

.sidebar__brand h1 {
    font-size: 28px;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
    font-family: "Cinzel", "Playfair Display", serif;
}

.sidebar__brand span {
    color: #c9a26b;
    text-shadow: 0 1px 3px rgba(201, 162, 107, 0.4);
}

.sidebar__brand p {
    font-size: 11px;
    color: rgba(253, 252, 251, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: "Inter", sans-serif;
    font-weight: 400;
}

.sidebar__logo {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(201, 162, 107, 0.3);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 600;
    color: rgba(253, 252, 251, 0.95);
    transition: all var(--transition-base);
    font-family: "Inter", sans-serif;
    font-size: 15px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(201, 162, 107, 0.35);
    cursor: pointer;
    background: rgba(253, 252, 251, 0.12);
    box-shadow: 0 8px 22px rgba(7, 14, 24, 0.35);
}

.nav-link .icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(201, 162, 107, 0.28);
    display: grid;
    place-items: center;
    font-size: 19px;
    transition: all var(--transition-base);
    color: #fdfcfb;
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.25);
}

.nav-link:hover {
    background: rgba(253, 252, 251, 0.22);
    border-color: rgba(201, 162, 107, 0.55);
    transform: translateX(6px);
    box-shadow: 0 10px 26px rgba(7, 14, 24, 0.45);
}

.nav-link:hover .icon {
    background: rgba(201, 162, 107, 0.38);
}

.nav-link--active {
    background: linear-gradient(140deg, rgba(201, 162, 107, 0.32), rgba(139, 115, 85, 0.26));
    color: #fdfcfb;
    border-color: #c9a26b;
    box-shadow: 0 12px 32px rgba(201, 162, 107, 0.35);
}

.nav-link--active .icon {
    background: rgba(253, 252, 251, 0.36);
    color: var(--color-primary-dark);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar__footer {
    padding-top: 16px;
    border-top: 1px solid rgba(201, 162, 107, 0.15);
}

.app__main {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.topbar {
    height: 96px;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 16px rgba(45, 52, 54, 0.04);
}

.topbar__title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar__title h2 {
    font-size: 28px;
    color: var(--color-primary);
}

.subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-family: "Inter", sans-serif;
    letter-spacing: 0.02em;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-primary);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.icon-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
    background: rgba(201, 162, 107, 0.05);
}

.icon-button:active {
    transform: scale(0.98);
}

.search {
    position: relative;
    width: 360px;
}

.search input {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border-radius: 8px;
    border: 2px solid var(--color-border);
    background: #fff;
    font-size: 15px;
    transition: all var(--transition-base);
    font-family: "Inter", sans-serif;
    box-shadow: inset 0 1px 3px rgba(45, 52, 54, 0.05);
}

.search input:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(201, 162, 107, 0.12), inset 0 1px 3px rgba(45, 52, 54, 0.05);
}

.search .icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--color-muted);
}

.user-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(201, 162, 107, 0.08), rgba(139, 115, 85, 0.06));
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(201, 162, 107, 0.2);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-family: "Cinzel", serif;
    box-shadow: 0 2px 8px rgba(201, 162, 107, 0.3);
}

.workspace {
    flex: 1;
    overflow-y: auto;
    padding: 36px 40px;
    animation: fade-slide-in 0.4s ease;
    min-height: 0;
}

.fade-slide {
    animation: fade-slide-in 0.4s ease;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.section-header h3 {
    font-size: 32px;
    color: var(--color-primary);
}

.section-header .actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.grid {
    display: grid;
    gap: 28px;
}

.grid--dashboard {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 28px;
    transition: all var(--transition-base);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

.card:hover::before {
    opacity: 1;
}

.card__title {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    font-family: "Inter", sans-serif;
}

.card__value {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-family: "Playfair Display", serif;
    color: var(--color-primary);
}

.card__meta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: "Inter", sans-serif;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    letter-spacing: 0.03em;
}

.tag--success {
    background: rgba(39, 174, 96, 0.12);
    color: var(--color-success);
}

.tag--warning {
    background: rgba(243, 156, 18, 0.12);
    color: var(--color-warning);
}

.tag--error {
    background: rgba(231, 76, 60, 0.12);
    color: var(--color-error);
}

.tag--info {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.table th,
.table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-family: "Inter", sans-serif;
}

.table th {
    background: linear-gradient(180deg, rgba(201, 162, 107, 0.12), rgba(201, 162, 107, 0.06));
    font-weight: 700;
    color: var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    border-bottom: 2px solid var(--color-accent);
}

.table tr:hover td {
    background: rgba(201, 162, 107, 0.06);
    transition: background var(--transition-base);
}

.table tbody tr {
    animation: fade-in 0.3s ease;
}

.table tbody tr.removing {
    animation: scale-out 0.3s forwards;
}

.table__actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.table tr:hover .table__actions {
    opacity: 1;
    transform: translateY(0);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 6px;
    padding: 14px 24px;
    border: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: "Inter", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fdfcfb;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25);
}

.btn--primary:hover {
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.35);
    transform: translateY(-2px);
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
    background: var(--color-primary);
    color: var(--color-surface);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn--ghost {
    background: rgba(139, 115, 85, 0.08);
    color: var(--color-text);
    border-color: transparent;
}

.btn--ghost:hover {
    background: rgba(139, 115, 85, 0.15);
    border-color: var(--color-secondary);
}

.btn--danger {
    background: var(--color-error);
    color: #fff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

.btn--danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.35);
    transform: translateY(-2px);
}

.btn--full {
    width: 100%;
}

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

.icon {
    font-size: 18px;
    line-height: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: "Inter", sans-serif;
}

.badge--success { background: rgba(39, 174, 96, 0.18); color: var(--color-success); }
.badge--warning { background: rgba(243, 156, 18, 0.18); color: var(--color-warning); }
.badge--danger { background: rgba(231, 76, 60, 0.18); color: var(--color-error); }

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(201, 162, 107, 0.1);
    border-radius: 6px;
    font-size: 13px;
    font-family: "Inter", sans-serif;
    border: 1px solid rgba(201, 162, 107, 0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.form-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-control label {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: "Inter", sans-serif;
}

.form-control input,
.form-control select,
.form-control textarea {
    border-radius: 6px;
    border: 2px solid var(--color-border);
    padding: 14px 16px;
    font-size: 15px;
    transition: all var(--transition-base);
    background: #fff;
    font-family: "Inter", sans-serif;
    box-shadow: inset 0 1px 3px rgba(45, 52, 54, 0.04);
}

.form-control textarea {
    min-height: 110px;
    resize: vertical;
}

.form-control input:focus,
.form-control select:focus,
.form-control textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(201, 162, 107, 0.15), inset 0 1px 3px rgba(45, 52, 54, 0.04);
}

.form-control input.error,
.form-control select.error {
    border-color: var(--color-error);
    animation: field-shake 0.4s ease;
}

.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-family: "Inter", sans-serif;
}

.toggle input {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

.toggle-track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: rgba(160, 152, 138, 0.3);
    position: relative;
    transition: background var(--transition-base);
    border: 1px solid var(--color-border);
}

.toggle-handle {
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translate3d(0, -50%, 0);
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(45, 52, 54, 0.2);
    transition: transform var(--transition-base);
}

.toggle input:checked + .toggle-track {
    background: rgba(201, 162, 107, 0.6);
    border-color: var(--color-accent);
}

.toggle input:checked + .toggle-track .toggle-handle {
    transform: translate3d(24px, -50%, 0);
}

.tabs {
    display: inline-flex;
    background: rgba(220, 215, 208, 0.3);
    border-radius: 8px;
    padding: 6px;
    border: 1px solid var(--color-border);
}

.tab {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 14px;
    font-family: "Inter", sans-serif;
    letter-spacing: 0.03em;
}

.tab--active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 20;
    animation: fade-in 0.3s ease;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 52, 54, 0.55);
    opacity: 0;
    animation: fade-in 0.3s forwards;
    backdrop-filter: blur(4px);
}

.modal__dialog {
    position: relative;
    width: min(960px, 96vw);
    max-height: 90vh;
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 20px 60px rgba(45, 52, 54, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92);
    animation: scale-in 0.3s forwards ease;
    border: 2px solid var(--color-accent);
}

.modal__dialog--large {
    width: min(1160px, 96vw);
}

.modal__dialog--medium {
    width: min(720px, 92vw);
}

.modal__dialog--small {
    width: min(480px, 92vw);
}

.modal__header {
    padding: 28px 36px;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(201, 162, 107, 0.04), transparent);
}

.modal__header h3 {
    font-size: 26px;
    color: var(--color-primary);
}

.modal__body {
    padding: 28px 36px;
    overflow-y: auto;
}

.modal__footer {
    padding: 24px 36px;
    border-top: 2px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(201, 162, 107, 0.03);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 52, 54, 0.55);
    z-index: 10;
    animation: fade-in 0.3s ease;
    backdrop-filter: blur(4px);
}

.hidden {
    display: none !important;
}

.toast {
    position: relative;
    min-width: 300px;
    max-width: 420px;
    background: var(--color-surface);
    padding: 18px 22px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(45, 52, 54, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 1px solid var(--color-border);
    animation: slide-in-right 0.3s ease forwards;
    margin-bottom: 12px;
}

.toast__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.toast__content {
    flex: 1;
    font-family: "Inter", sans-serif;
}

.toast__title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 15px;
}

.toast__close {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-muted);
    font-size: 18px;
}

.toast--success .toast__icon { background: rgba(39, 174, 96, 0.18); color: var(--color-success); }
.toast--error .toast__icon { background: rgba(231, 76, 60, 0.18); color: var(--color-error); }
.toast--info .toast__icon { background: rgba(52, 152, 219, 0.18); color: #3498db; }
.toast--warning .toast__icon { background: rgba(243, 156, 18, 0.18); color: var(--color-warning); }

.invoice-preview {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin: 0 auto;
}

.invoice-template-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.template-chip {
    border-radius: 12px;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 18px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.template-chip:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.template-chip.selected {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(201, 162, 107, 0.15);
}

.template-chip img {
    width: 100%;
    border-radius: 8px;
}

.template-chip h4 {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
}

.invoice-items-table {
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--color-border);
}

.invoice-items-table table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    background: #fff;
    font-family: "Inter", sans-serif;
}

.invoice-items-table th {
    background: linear-gradient(180deg, rgba(201, 162, 107, 0.12), rgba(201, 162, 107, 0.06));
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
}

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

.invoice-item-row {
    animation: fade-in 0.25s ease;
}

.invoice-item-row.removing {
    animation: scale-out 0.25s forwards;
}

.input-inline {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all var(--transition-base);
    font-family: "Inter", sans-serif;
}

.invoice-items-table .input-inline[type="number"] {
    min-width: 68px;
    padding-right: 20px;
    box-sizing: border-box;
}

.invoice-items-table .input-inline[name="quantity"] {
    text-align: center;
    min-width: 80px;
}

.invoice-items-table .input-inline[name="rate"] {
    text-align: right;
}

.input-inline:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(201, 162, 107, 0.04);
}

.summary-panel {
    margin-top: 28px;
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201, 162, 107, 0.08), rgba(139, 115, 85, 0.06));
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    border: 1px solid rgba(201, 162, 107, 0.2);
}

.summary-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.summary-card h5 {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    font-family: "Inter", sans-serif;
}

.summary-card .amount {
    font-family: "Playfair Display", serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
    background: var(--color-surface);
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px dashed var(--color-border);
}

.empty-state img {
    width: 240px;
    margin-bottom: 28px;
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 26px;
    margin-bottom: 10px;
    color: var(--color-primary);
}

.empty-state p {
    color: var(--color-text-secondary);
    max-width: 460px;
    font-size: 16px;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.timeline__item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 20px;
    align-items: start;
}

.timeline__date {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: right;
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

.timeline__card {
    padding: 16px 20px;
    border-radius: 10px;
    background: rgba(201, 162, 107, 0.06);
    border-left: 3px solid var(--color-accent);
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
    box-shadow: 0 2px 8px rgba(201, 162, 107, 0.3);
}

.report-chart {
    width: 100%;
    min-height: 300px;
}

.progress {
    width: 100%;
    background: rgba(220, 215, 208, 0.3);
    border-radius: 999px;
    overflow: hidden;
    height: 10px;
}

.progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(220, 215, 208, 0.4), rgba(220, 215, 208, 0.8), rgba(220, 215, 208, 0.4));
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-slide-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes scale-out {
    to { opacity: 0; transform: scale(0.88); height: 0; }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes field-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 600ms linear;
    background-color: rgba(201, 162, 107, 0.5);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.fab {
    position: fixed;
    bottom: 36px;
    right: 36px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-secondary));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(201, 162, 107, 0.4);
    cursor: pointer;
    z-index: 5;
    transition: all var(--transition-base);
}

.fab:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(201, 162, 107, 0.5);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(201, 162, 107, 0.12);
    color: var(--color-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-family: "Inter", sans-serif;
    border: 1px solid rgba(201, 162, 107, 0.25);
}

.invoice-preview-wrapper {
    background: rgba(220, 215, 208, 0.15);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
}

.invoice-preview-controls {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.invoice-preview canvas {
    width: 100%;
}

.payment-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    font-family: "Inter", sans-serif;
}

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tagline {
    font-size: 13px;
    color: rgba(253, 252, 251, 0.7);
    font-family: "Inter", sans-serif;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 22px 24px;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(80px, max-content));
    gap: 20px;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--color-border);
    border-left: 4px solid transparent;
}

.list-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-accent);
}

.list-item__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: "Inter", sans-serif;
}

.list-item__meta strong {
    font-weight: 700;
    color: var(--color-primary);
}

.list-item__actions {
    display: flex;
    gap: 8px;
}

.badge-amount {
    font-family: "Playfair Display", serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.detail-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.detail-card h4 {
    margin-bottom: 16px;
    color: var(--color-primary);
    font-size: 20px;
}

.detail-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 15px;
    font-family: "Inter", sans-serif;
}

.detail-card li strong {
    display: inline-block;
    width: 130px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.bank-card {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(26, 37, 47, 0.95));
    color: #fff;
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.3);
    border: 1px solid rgba(201, 162, 107, 0.2);
}

.bank-card h4 {
    font-size: 20px;
    letter-spacing: 0.05em;
    color: var(--color-accent);
}

.bank-card .row {
    display: flex;
    justify-content: space-between;
    font-family: "Inter", sans-serif;
    font-size: 14px;
}

.accordion {
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.accordion__item + .accordion__item {
    border-top: 1px solid var(--color-border);
}

.accordion__header {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 18px;
    transition: background var(--transition-base);
    font-family: "Playfair Display", serif;
}

.accordion__header:hover {
    background: rgba(201, 162, 107, 0.04);
}

.accordion__content {
    padding: 0 28px 24px;
    display: none;
}

.accordion__item.open .accordion__content {
    display: block;
}

.invoice-template-preview {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.invoice-template-preview iframe {
    width: 100%;
    height: 700px;
    border: none;
    border-radius: 8px;
}

.barcode-placeholder {
    width: 180px;
    height: 50px;
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, #000, #000 4px, transparent 4px, transparent 8px);
}

.signature-placeholder {
    width: 180px;
    height: 70px;
    border-bottom: 2px solid rgba(45, 52, 54, 0.3);
}

.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-warning);
    box-shadow: 0 0 0 2px #fff;
}

#toast-host {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

@media (max-width: 1280px) {
    :root {
        --sidebar-width: 260px;
    }

    .topbar {
        padding: 18px 28px;
    }

    .search {
        width: 300px;
    }
}

@media (max-width: 1024px) {
    body {
        overflow: auto;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-105%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    }

    .app {
        flex-direction: column;
    }

    .app__main {
        margin-left: 0;
    }

    .topbar__title h2 {
        font-size: 24px;
    }

    .workspace {
        padding: 28px;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        gap: 16px;
        height: auto;
    }

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

    .search {
        width: 100%;
    }

    .workspace {
        padding: 20px;
    }

    .grid--dashboard {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .list-item {
        grid-template-columns: 1fr;
    }

    .card__value {
        font-size: 32px;
    }
}
