/*
 * GUARDIAN GT — Layout System
 * Fixed sidebar (240px), toolbar (48px), responsive main content
 */

/* ──────────────────────────────────────────────── */
/* App Shell Layout                                 */
/* ──────────────────────────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ──────────────────────────────────────────────── */
/* Toolbar (Fixed Top 48px)                         */
/* ──────────────────────────────────────────────── */
.ggt-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--toolbar-height);
    background: var(--sap-toolbar-bg);
    color: var(--on-primary);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--outline-variant);
}

.ggt-toolbar__title {
    font-size: 20px;
    font-weight: 700;
}

.ggt-toolbar__breadcrumb {
    opacity: 0.9;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ggt-toolbar__separator {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 8px;
}

.ggt-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ggt-toolbar__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--on-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.ggt-toolbar__btn:hover {
    background: var(--primary-container);
}
.ggt-toolbar__btn:active {
    opacity: 0.7;
}

/* ──────────────────────────────────────────────── */
/* Sidebar (Fixed Left 240px)                       */
/* ──────────────────────────────────────────────── */
.ggt-sidebar {
    position: fixed;
    left: 0;
    top: var(--toolbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--toolbar-height));
    background: var(--surface-container-lowest);
    border-right: 1px solid var(--border-subtle);
    z-index: 40;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width 0.25s ease, transform 0.25s ease;
}

.ggt-sidebar.collapsed {
    transform: translateX(-100%);
    width: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: none !important;
}

.ggt-sidebar__header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.ggt-sidebar__brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.ggt-sidebar__subtitle {
    font-size: 10px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.ggt-sidebar__nav {
    flex: 1;
    padding: 8px 0;
}

.ggt-sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all 0.15s;
    border-left: 4px solid transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.ggt-sidebar__item:hover {
    background: var(--surface-variant);
    text-decoration: none;
}

.ggt-sidebar__group {
    border-bottom: 1px solid var(--surface-container-high);
}

.ggt-sidebar__group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    background: var(--surface-container-low);
    user-select: none;
}
.ggt-sidebar__group-header:hover {
    background: var(--surface-container-high);
}

.ggt-sidebar__subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 32px;
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.ggt-sidebar__subitem:hover {
    background: var(--surface-variant);
    color: var(--primary);
    text-decoration: none;
}
.ggt-sidebar__subitem.active {
    background: var(--secondary-container);
    color: var(--primary);
    border-left-color: var(--primary);
}

.ggt-sidebar__item.active {
    background: var(--secondary-container);
    color: var(--primary);
    border-left-color: var(--primary);
}

.ggt-sidebar__footer {
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0;
}

/* ──────────────────────────────────────────────── */
/* Main Content Area                                */
/* ──────────────────────────────────────────────── */
.ggt-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--toolbar-height);
    flex: 1;
    overflow: auto;
    padding: var(--gutter);
    background: var(--surface-bright);
    transition: margin-left 0.25s ease, width 0.25s ease;
}

.ggt-main.main-expanded {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.ggt-main__container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ──────────────────────────────────────────────── */
/* Page Card (white container with border)          */
/* ──────────────────────────────────────────────── */
.ggt-page-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}

/* ──────────────────────────────────────────────── */
/* Document Header (title + status bar)             */
/* ──────────────────────────────────────────────── */
.ggt-doc-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-container-low);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ggt-doc-header__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ggt-doc-header__subtitle {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 4px;
}

/* ──────────────────────────────────────────────── */
/* Grid System                                      */
/* ──────────────────────────────────────────────── */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gutter); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }

/* ──────────────────────────────────────────────── */
/* Login Layout (full page, no sidebar)             */
/* ──────────────────────────────────────────────── */
.ggt-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sap-toolbar-bg) 0%, var(--primary) 100%);
}

.ggt-login-card {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}
