/* Plans V1.4 professional skin - based on the supplied custom template assets. */
:root {
    --plans-canvas-bg: #e9f0f7;
    --plans-ink: #274d73;
    --plans-soft: #edf2f8;
    --plans-white: #ffffff;
    --plans-line: #dbe5ef;
}

body.app-body,
body.auth-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--font-size);
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(66, 189, 203, .16), transparent 32rem),
        linear-gradient(135deg, #ffffff 0%, #edf7fb 100%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.app-shell {
    grid-template-columns: 230px 1fr;
}

.app-sidebar {
    padding: 12px 10px;
    border-right: 1px solid var(--border);
    background: #fff;
}

.app-main {
    background: #f8fbfe;
    min-height: 100vh;
}

.app-navbar {
    box-shadow: 0 8px 20px rgba(66, 189, 203, .16);
}

.nav-user {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.app-brand {
    min-height: 66px;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.brand-title,
.brand-subtitle {
    display: block;
}

.brand-title {
    color: var(--primary);
    font-size: 18px;
    line-height: 1.1;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--plans-ink);
    font-weight: 800;
    transition: .15s ease;
}

.side-link img {
    width: 18px;
    height: 18px;
}

.side-link:hover,
.side-link:focus {
    background: var(--btndefaultlight);
    border-color: var(--borderfocus);
    color: var(--primary);
}

.sidebar-user {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navbar);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user small {
    color: var(--muted);
    margin-top: 2px;
}

.page {
    padding: 14px;
}

.card,
.panel,
.login-card,
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.card {
    padding: 18px;
    margin-bottom: 14px;
}

.login-card {
    width: min(430px, 100%);
    padding: 26px;
}

.login-card::before {
    content: '';
    display: block;
    width: 130px;
    height: 60px;
    background: url('../images/ecslogo.png') center / contain no-repeat;
    margin: 0 auto 14px;
}

.login-card h1,
.card h1,
.panel h2,
.panel h3,
.form-card h1 {
    color: var(--titled);
    margin-top: 0;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
}

.hint,
.field small,
.project-card p {
    color: var(--muted);
    line-height: 1.45;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    color: var(--plans-ink);
    font-weight: 900;
    margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: var(--control-h);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    background: #fff;
    color: var(--plans-ink);
    font: inherit;
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--borderfocus);
    box-shadow: var(--focus);
}

.btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: var(--radius-btn);
    padding: 8px 13px;
    background: var(--btndefault);
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: .15s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    filter: brightness(.97);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--primary);
}

.btn.light {
    background: var(--btndefaultlight);
    border-color: var(--border);
    color: var(--primary);
}

.btn.danger {
    background: var(--danger);
}

.btn.good {
    background: var(--success);
}

.btn.small {
    min-height: 28px;
    padding: 6px 9px;
    font-size: 12px;
}

.alert {
    border-radius: 10px;
    padding: 11px 13px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert.error {
    background: #fff1f1;
    border-color: #ffd3d4;
    color: #a82f32;
}

.alert.ok {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #047857;
}

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

.project-card h3 {
    margin: 0 0 7px;
    color: var(--plans-ink);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.page-head h1 {
    margin: 0 0 4px;
}

.table-wrap {
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: var(--btndefaultlight);
    color: var(--plans-ink);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.data-table .right {
    text-align: right;
}

.actions {
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin: 0 0 0 6px;
}

.status {
    display: inline-block;
    border-radius: var(--radius-pill);
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
}

.status.ok {
    background: #dcfce7;
    color: #166534;
}

.status.off {
    background: #fee2e2;
    color: #991b1b;
}

.form-card {
    max-width: 680px;
    padding: 18px;
}

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

.check {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--plans-ink);
    font-weight: 800;
    margin: 8px 0 12px;
}

/* Editor */
.editor-shell {
    display: grid;
    grid-template-columns: 315px minmax(520px, 1fr) 315px;
    gap: 12px;
    height: calc(100vh - 78px);
}

.panel {
    overflow: auto;
}

.panel .pad {
    padding: 14px;
}

.panel h2 {
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tool {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 11px 8px;
    color: var(--plans-ink);
    text-align: center;
    cursor: pointer;
    font-weight: 900;
}

.tool.active,
.tool:hover {
    border-color: var(--navbar);
    background: #eafafd;
    box-shadow: inset 0 0 0 2px rgba(66, 189, 203, .18);
}

.stage-wrap {
    background:
        linear-gradient(45deg, rgba(67,115,163,.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(67,115,163,.05) 25%, transparent 25%),
        var(--plans-canvas-bg);
    background-size: 20px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}

.stage-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 4;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.paper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(39, 77, 115, .22);
    border: 1px solid #d7e3ef;
}

#planCanvas {
    display: block;
    border-radius: 8px;
    touch-action: none;
}

.pill {
    display: inline-block;
    background: #eafafd;
    color: var(--primary);
    border: 1px solid rgba(66, 189, 203, .35);
    border-radius: var(--radius-pill);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.edit-box {
    border: 1px solid var(--border);
    background: #f8fbfe;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}

.edit-box h3 {
    margin: 0 0 10px;
}

.asset-list {
    display: grid;
    gap: 8px;
}

.asset-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px;
    background: #fff;
    cursor: pointer;
    transition: .15s ease;
}

.asset-row:hover {
    border-color: var(--navbar);
    box-shadow: var(--shadow-sm);
}

.asset-row strong {
    display: block;
    color: var(--plans-ink);
}

.asset-row span {
    color: var(--muted);
    font-size: 12px;
}

.hidden {
    display: none !important;
}

.client-sheet {
    max-width: 1080px;
    margin: 16px auto;
    background: #fff;
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.client-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 3px solid var(--navbar);
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.client-header h1 {
    color: var(--plans-ink);
    margin: 0 0 6px;
}

.client-plan img {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.client-sheet table {
    border-collapse: collapse;
}

.client-sheet th {
    background: var(--btndefaultlight);
}

.client-sheet td,
.client-sheet th {
    border: 1px solid #cbd5e1;
    padding: 8px;
}

@media (max-width: 1180px) {
    .editor-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .stage-wrap {
        min-height: 720px;
    }

    .panel {
        max-height: none;
    }
}

@media (max-width: 720px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: relative;
        height: auto;
    }

    .side-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar .nav {
        display: none;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media print {
    .app-sidebar,
    .app-navbar,
    .topbar,
    .no-print,
    .btn {
        display: none !important;
    }

    .app,
    .app-shell {
        display: block;
    }

    .page {
        padding: 0;
    }

    .client-sheet {
        box-shadow: none;
        border: none;
        margin: 0;
    }
}
