:root {
    --pws-navy: #10263f;
    --pws-navy-dark: #0b1b2e;
    --pws-blue: #1769aa;
    --pws-blue-hover: #12598f;
    --pws-bg: #f4f7fa;
    --pws-card: #ffffff;
    --pws-border: #dfe6ee;
    --pws-text: #1f2937;
    --pws-muted: #64748b;
    --pws-success: #198754;
    --pws-warning: #b7791f;
    --pws-danger: #b42318;
}

html,
body {
    min-height: 100%;
}

body.pws-body {
    margin: 0;
    background: var(--pws-bg);
    color: var(--pws-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

/* Header */

.pws-header {
    background: linear-gradient(90deg, #10263f, #163453);
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    color: white;
    flex-shrink: 0;
}

.pws-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 10px;
    padding: 5px;
}

.pws-product-name {
    white-space: nowrap;
    font-size: 1.25rem;
    font-weight: 700;
}

.pws-station-name {
    color: rgba(255,255,255,.75);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* Navigation */

.pws-nav {
    background: var(--pws-navy-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pws-nav .nav-link {
    color: #d8e2ec;
    padding: 14px 16px;
    font-weight: 500;
}

.pws-nav .nav-link:hover,
.pws-nav .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Main layout */

.pws-main {
    padding: 28px 24px 42px;
}

/* Selection Bar */
.pws-selection-bar {
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid var(--pws-border);
    border-radius: 10px;
    background: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    color: var(--pws-muted);
}

.pws-selection-bar.has-selection {
    background: #f3f8ff;
    border-color: #b6d4fe;
    color: var(--pws-text);
}

@media (max-width: 768px) {
    .pws-selection-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .pws-selection-bar > div:last-child {
        flex-wrap: wrap;
    }
}

/* Cards */

.pws-card {
    background: var(--pws-card);
    border: 1px solid var(--pws-border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    padding: 22px;
}

.pws-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pws-navy);
    margin-bottom: 16px;
}

.pws-drive-serial {
    font-size: 0.85rem;
    word-break: break-all;
}

.pws-drive-selectable {
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.pws-drive-selectable:hover {
    border-color: #9ec5fe;
}

.pws-drive-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.pws-drive-selectable.pws-selected {
    background: #f3f8ff;
    border-color: #6ea8fe;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.08);
}

.pws-remote-drive-selectable.pws-selected {
    background: #f5b0b0;
    border-color: #fe6e6e;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.08);
}

.pws-card-system {
    background: #f8fafc;
    cursor: not-allowed;
}

/* Remote Cards */
.pws-remote-node {
    background: #fff7f7;
    border: 1px solid #f3d6d6;
}

.pws-remote-node .pws-card {
    background: #fffafa;
}

.pws-remote-node-header {
    border-bottom: 1px solid #f3d6d6;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.pws-remote-badge {
    background: #b42318;
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: .35rem;
}


/* Buttons */

.btn-pws-primary {
    background: var(--pws-blue);
    color: #ffffff;
    border: 1px solid var(--pws-blue);
}

.btn-pws-primary:hover {
    background: var(--pws-blue-hover);
    border-color: var(--pws-blue-hover);
    color: #ffffff;
}

/* Status badges */

.pws-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 10px;
}

.pws-status-ready {
    color: #146c43;
    background: #d1e7dd;
}

.pws-status-warning {
    color: #7a4b00;
    background: #fff3cd;
}

.pws-status-error {
    color: #842029;
    background: #f8d7da;
}

.pws-status-danger {
    color: #842029;
    background: #f8d7da;
}

.pws-status-system {
    background: hsl(342, 98%, 52%);
    color: white;
}

.pws-status-pending {
    background: #eef1f4;
    color: #495057;
}

.pws-status-running {
    background: #e7f1ff;
    color: #0a58ca;
}

.pws-status-verifying {
    background: #f1e8ff;
    color: #6f42c1;
}

.pws-status-recent {
    background: #d1e7dd;
    color: #0f5132;
}

.pws-status-failed {
    background: #f8d7da;
    color: #842029;
}

.pws-status-cancelled {
    background: #e2e3e5;
    color: #41464b;
}

/* Forms */

.form-label {
    font-weight: 600;
    color: #334155;
}

.form-control,
.form-select {
    border-color: #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--pws-blue);
    box-shadow: 0 0 0 0.2rem rgba(23, 105, 170, 0.12);
}

/* Footer */

.pws-footer {
    border-top: 1px solid var(--pws-border);
    background: #ffffff;
    color: var(--pws-muted);
    padding: 16px 24px;
    font-size: 0.82rem;
}

/* Login */

.pws-login-wrap {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 18px;
}

.pws-login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border: 1px solid var(--pws-border);
    border-radius: 14px;
    padding: 34px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
}

.pws-login-title {
    color: var(--pws-navy);
    font-size: 1.5rem;
    font-weight: 700;
}

.pws-login-subtitle {
    color: var(--pws-muted);
    font-size: 0.9rem;
}

.pws-remote-access {
    background: #f8fafc;
    border: 1px solid var(--pws-border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

/* Utilities */

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

.pws-section-heading {
    color: var(--pws-navy);
    font-weight: 700;
    margin-bottom: 18px;
}

/* Responsive */

@media (max-width: 768px) {
    .pws-header {
        padding: 10px 16px;
    }

    .pws-main {
        padding: 20px 14px 32px;
    }

    .pws-brand-logo {
        width: 44px;
        height: 44px;
    }

    .pws-product-name {
        font-size: 1.05rem;
    }
}

/* ============================================================
   Application Shell
   ============================================================ */

.pws-app-shell {
    display: flex;
    min-height: 100vh;
}

.pws-sidebar {
    width: 300px;
    background: linear-gradient(180deg, #10263f, #0b1b2e);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.pws-sidebar-brand {
    height: 79px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 16px;
    flex-shrink: 0;
}

.pws-content-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pws-header {
    background: linear-gradient(90deg,#10263f,#163453);
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    color: white;
}

.pws-main {
    flex: 1;
    padding: 28px;
}

.pws-footer {
    border-top: 1px solid var(--pws-border);
    background: white;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    color: var(--pws-muted);
    font-size: .85rem;
}

/* ============================================================
   Sidebar Navigation
   ============================================================ */

.pws-nav {
    padding: 14px;
}

.pws-nav .nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pws-nav .nav-link {
    border-radius: 10px;
    color: rgba(255,255,255,.82);
    font-weight: 600;
    padding: 12px 16px;
    transition: .15s;
}

.pws-nav .nav-link i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.pws-nav .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: white;
}

.pws-nav .nav-link.active {
    background: #2563eb;
    color: white;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 992px){

    .pws-sidebar{
        width:72px;
    }

    .pws-sidebar-brand div{
        display:none;
    }

    .pws-nav .nav-link{
        text-align:center;
        padding:14px 0;
    }

    .pws-nav .nav-link i{
        margin:0;
        width:auto;
        font-size:1.25rem;
    }

    .pws-nav .nav-link span{
        display:none;
    }
}