/* Custom Adjustments for Modern Leonics MOC */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    background: var(--bg-main, #f5f5f0);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

.content-container {
    flex: 1;
    padding: 16px 24px 40px 24px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Card Spacing and Padding Polish */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.metric-box {
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.metric-box .lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-box .val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    margin-top: 2px;
}

/* Phase Table Polish */
.phase-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.phase-table th {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    text-align: right;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-default);
}

.phase-table td {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 9px 10px;
    text-align: right;
    border-bottom: 1px solid var(--border-default);
}

.phase-table td:first-child,
.phase-table th:first-child {
    text-align: left;
}


.tab-pane {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

[v-cloak] {
    display: none !important;
}

/* Central data readiness state. Individual graphs still keep their own
   status labels, while this overlay blocks pages that cannot render without
   a site list or the first telemetry snapshot. */
.app-data-state {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(2px);
}

.app-data-state-card {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 24px;
    text-align: center;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.app-data-state-card strong {
    font-size: 15px;
}

.app-data-state-card span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.app-data-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e2e8f0;
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: appDataSpin 0.8s linear infinite;
}

.app-data-error-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #b45309;
    background: #fef3c7;
    font-weight: 700;
    font-size: 20px;
}

.app-data-retry {
    margin-top: 6px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: #0f172a;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.app-data-retry:hover {
    background: #1e293b;
}

@keyframes appDataSpin {
    to { transform: rotate(360deg); }
}

/* Footer Status Stamp (RMUTL Standard - Transparent & Container-Width) */
.stamp#status-stamp {
    margin-top: 12px;
    padding: 8px 4px 0 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary, #888);
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-top: none !important;
    box-shadow: none !important;
    width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1;
}

.stamp .offline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger, #ef4444);
    font-weight: 500;
}

.stamp .offline::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--danger, #ef4444);
    border-radius: 50%;
}

/* ======================================================
   LOGIN VIEW STYLING (Leonics Standard)
   ====================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f0;
    padding: 24px;
    box-sizing: border-box;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-brand-icon img {
    display: block;
    width: 48px;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
}

.login-brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.login-brand-sub {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 30px 26px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.login-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 22px;
}

.login-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #b91c1c;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.login-field input[type="text"],
.login-field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    background: #fafaf7;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.login-field input:focus {
    border-color: #0f172a;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.login-pw-wrap {
    position: relative;
}

.login-pw-wrap input {
    padding-right: 44px;
}

.login-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-pw-toggle:hover {
    color: #334155;
}

.login-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.login-btn:hover:not(:disabled) {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-foot-notice {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #94a3b8;
}
