:root {
    --primary-color: #2c3e50;
    --primary-color-light: #637281;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
}

/* 1. Global Reset & Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* We handle scrolling inside containers */
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* 2. Main View Containers (Managed by Router) */
#fullView, #appView {
    width: 100vw;
    height: 100vh;
}

#appView {
    flex-direction: column;
}

#appViewFormCon {
    display: flex;
    flex: 1;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    width: 100%;
}

/* 3. The Portal Layer (Overlays & Toasts) */
#portal-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Allows clicking through to app when empty */
    z-index: 9999;
    display: none; /* Router toggles this */
    justify-content: center;
    align-items: center;
}
#portal-layer.active {
    pointer-events: all;
    background: rgba(0,0,0,0.4);
}

/* 4. Common Component Styles (Used by Splash & Login) */
.gFrmFull {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.gFrmHeader{
    display: flex;
    flex-flow: row nowrap;
    padding: 5px;
    gap: 10px;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
}
.gFrmHeader img{
    height: 30;
    width: 30;
}
.gFrmHeader span{
    font-size: 120%;
    font-weight: bold;
}


.gFrmBody {
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    background: var(--white);
    padding: 10px;
    border-radius: 0px 0px 10px 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
}

.gResponsiveCon{
    display: flex;
    flex-flow: column wrap;
    gap: 10px;
    width: 100%;
}

.gBtnBack{
    cursor: pointer;
    height: 30px;
    width: 30px;
}

.welcomCon .logo {
    width: 80px;
    margin-bottom: 20px;
}

.welcomCon span {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.welcomCon p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 30px;
}

/* 5. Inputs & Buttons */
input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

input.is-dirty {
    border-color: var(--accent-color);
    background-color: #f0f8ff;
}

.gBtnPrimary {
    padding: 12px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.2s;
}

.gBtnPrimary:hover {
    background-color: #2980b9;
}

.gBtnCancel {
    padding: 10px 16px;
    background-color: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.gBtnCancel:hover {
    background-color: #c0392b;
    color: white;
}

/* Curved-arrow return button — pure CSS, no image needed */
.gBtnClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #888;
    border-radius: 50%;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.gBtnClose::before {
    content: '↩';
    font-size: 1.2rem;
    color: #555;
    line-height: 1;
    transition: color 0.2s;
}

.gBtnClose:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.gBtnClose:hover::before {
    color: white;
}

/* 6. Animations */
@keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}