html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    min-height: 100vh;
    overflow: auto;
}

.sidebar {
    width: 230px;
    background: linear-gradient(180deg, #10243b 0%, #152f4d 100%);
    color: #f3f7ff;
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    border-right: 1px solid #223c57;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 8px 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.sidebar-brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-logo-sidebar {
    max-height: 48px;
    max-width: 180px;
    object-fit: contain;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    color: #dce8f7;
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 10px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 10px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #153256 0%, #184875 45%, #1f6293 100%);
}

.login-card {
    width: 360px;
    background: #f9fbff;
    border: 1px solid #d5dfef;
    border-radius: 12px;
    padding: 22px 20px;
    box-shadow: 0 20px 40px rgba(8, 23, 45, 0.28);
}

.login-card.register-card {
    width: 420px;
    max-width: 95vw;
}

.module-page,
.dashboard-page {
    padding: 16px;
}

.desktop-area {
    position: relative;
    min-height: 1200px;
    overflow: auto;
    background: linear-gradient(135deg, #153256 0%, #184875 45%, #1f6293 100%);
}

.toast-status {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-weight: 600;
}

.toast-success {
    background: rgba(20, 120, 56, 0.95);
}

.toast-error {
    background: rgba(182, 42, 42, 0.95);
}

.window-card {
    position: absolute;
    border-radius: 10px;
    border: 1px solid #1f2b3a;
    background: #f7f8fb;
    box-shadow: 0 18px 35px rgba(7, 15, 32, 0.35);
    overflow: hidden;
    min-width: 280px;
}

.window-card.is-hidden .window-content {
    display: none;
}

.window-titlebar {
    user-select: none;
    cursor: move;
    background: linear-gradient(180deg, #1f3550 0%, #17293f 100%);
    color: #f2f6ff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.window-actions {
    display: flex;
    gap: 6px;
}

.window-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #4b6078;
    border-radius: 4px;
    background: #243a56;
    color: #f2f6ff;
    line-height: 1;
    cursor: pointer;
}

.window-btn:hover {
    background: #2d4c71;
}

.window-content {
    padding: 12px;
    background: #fdfdff;
}

.dock-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: flex-end;
}

.dock-btn {
    border: 1px solid #7f93aa;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
}

.dock-btn:hover {
    background: #ffffff;
}

.invoice-totals {
    margin-left: auto;
    width: 240px;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    background: #f8fbff;
    padding: 8px 10px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.totals-grand {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #cbd8ea;
    font-size: 1.06rem;
}

.window-types-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 118px;
    overflow: auto;
    padding: 4px;
    border: 1px solid #d5dfef;
    border-radius: 8px;
    background: #f7faff;
}

.type-pill {
    border: 1px solid #9db3cc;
    background: #ffffff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.75rem;
}

.type-pill:hover {
    background: #e9f2ff;
}

.window-types-grid {
    display: grid;
    grid-template-columns: repeat(14, minmax(110px, 1fr));
    gap: 8px;
    max-height: 520px;
    overflow: auto;
    padding-right: 3px;
}

.type-card {
    border: 1px solid #d2deef;
    border-radius: 8px;
    padding: 6px;
    background: #ffffff;
}

.type-figure {
    height: 74px;
    border: 1px solid #889ab1;
    background: #a3b3c4;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-shape {
    width: 68%;
    height: 80%;
    background: #6eeeff;
    border: 2px solid #427185;
    position: relative;
}

.glass-shape::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 44%, rgba(255, 255, 255, 0.7) 45%, transparent 48%);
}

.shape-1 {
    border-radius: 0 0 20px 0;
}

.shape-2 {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 85%);
}

.shape-3 {
    border-radius: 40% 40% 0 0;
}

.shape-4 {
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

.shape-5 {
    border-radius: 50%;
}

.type-name {
    margin-top: 5px;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.2;
    min-height: 30px;
}

.config-tabs {
    border: 1px solid #d8e2f1;
    border-radius: 8px;
    background: #f9fbff;
}

.config-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    border-bottom: 1px solid #d8e2f1;
}

.config-tab-btn {
    border: 1px solid #2a2a2a;
    color: #fff;
    padding: 5px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.config-tab-btn.is-active {
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.7);
}

.c-red { background: #8f1111; }
.c-cyan { background: #067e9f; }
.c-green { background: #0f7b36; }
.c-blue { background: #0f3f8d; }
.c-blue2 { background: #073465; }
.c-dark { background: #121212; }
.c-olive { background: #5b6f16; }
.c-navy { background: #00396f; }
.c-red2 { background: #8f2e2e; }
.c-brown { background: #7b1e1e; }

.config-tab-panels {
    padding: 10px;
}

.config-panel {
    display: none;
}

.config-panel.is-active {
    display: block;
}

.photo-picker-btn {
    border: 1px solid #9aacbf;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
    width: 42px;
    height: 30px;
}

.photo-picker-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.window-picker-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.window-picker-content {
    width: min(1100px, 95vw);
    max-height: 82vh;
    overflow: auto;
    background: #fdfdff;
    border-radius: 10px;
    border: 1px solid #ced9ea;
    padding: 10px;
}

.window-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
}

.window-picker-item {
    border: 1px solid #c5d3e8;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    text-align: left;
}

.window-picker-item img {
    width: 100%;
    height: 76px;
    object-fit: contain;
    background: #f5f8fc;
    border: 1px solid #d2deef;
}

.window-picker-item span {
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
    line-height: 1.2;
}

.window-picker-item small {
    color: #1d5c95;
}