/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header .header-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--arch-blue), var(--arch-blue-mid));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a2741;
    margin: 0 0 2px;
}

.page-header p {
    color: #6b7a99;
    margin: 0;
    font-size: 0.9rem;
}

/* ── Layout ───────────────────────────────────────────────── */
.guidelines-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 190px);
    min-height: 480px;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.gl-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30, 111, 217, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.gl-sidebar-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1a2741;
    background: linear-gradient(135deg, rgba(30,111,217,0.06) 0%, rgba(46,139,239,0.04) 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.gl-file-count {
    margin-left: auto;
    background: var(--arch-blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.gl-search {
    margin: 10px 12px;
    padding: 7px 12px;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.18s;
}
.gl-search:focus { border-color: var(--arch-blue-light); }

.gl-file-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 8px;
}

.gl-file-item {
    padding: 9px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gl-file-item:hover {
    background: rgba(30, 111, 217, 0.05);
    border-left-color: var(--arch-blue-light);
}

.gl-file-item.active {
    background: rgba(30, 111, 217, 0.10);
    border-left-color: var(--arch-blue);
}

.gl-file-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: #1a2741;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-file-item.active .gl-file-name { color: var(--arch-blue); }

.gl-file-date {
    font-size: 0.73rem;
    color: #8a9bbf;
}

.gl-empty {
    padding: 24px 16px;
    text-align: center;
    color: #8a9bbf;
    font-size: 0.87rem;
}

/* ── Main panel ───────────────────────────────────────────── */
.gl-main {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30, 111, 217, 0.08);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gl-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #b0bcce;
    font-size: 0.95rem;
    gap: 12px;
}

.gl-placeholder i { font-size: 3rem; }

/* ── Editor toolbar ───────────────────────────────────────── */
.gl-toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fafbfd;
}

.gl-filename-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a2741;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-modified {
    font-size: 0.78rem;
    color: #8a9bbf;
}

.gl-tab-btn {
    padding: 5px 14px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #4a5568;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gl-tab-btn:hover { background: #f0f4f8; border-color: #b0bcce; }

.gl-tab-btn.active {
    background: var(--arch-blue);
    color: #fff;
    border-color: var(--arch-blue);
}

.gl-save-btn {
    padding: 6px 18px;
    background: linear-gradient(135deg, var(--arch-blue), var(--arch-blue-mid));
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.18s, transform 0.12s;
}

.gl-save-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.gl-save-btn:active { transform: translateY(0); }
.gl-save-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Editor / Preview body ────────────────────────────────── */
.gl-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.gl-editor {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 18px 20px;
    font-family: 'Cascadia Code', 'Fira Mono', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    color: #1a2741;
    background: #fff;
    tab-size: 2;
}

.gl-preview {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px 28px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: #1e293b;
}

/* Markdown preview typography */
.gl-preview h1, .gl-preview h2, .gl-preview h3,
.gl-preview h4, .gl-preview h5, .gl-preview h6 {
    color: #1a2741;
    font-weight: 700;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}
.gl-preview h1 { font-size: 1.5rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; }
.gl-preview h2 { font-size: 1.2rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; }
.gl-preview h3 { font-size: 1.05rem; }
.gl-preview p { margin-bottom: 0.8em; }
.gl-preview ul, .gl-preview ol { padding-left: 1.4em; margin-bottom: 0.8em; }
.gl-preview li { margin-bottom: 0.25em; }
.gl-preview code {
    background: #f0f4f8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85em;
    color: var(--arch-blue);
}
.gl-preview pre {
    background: #1a2741;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    overflow-x: auto;
    margin-bottom: 1em;
}
.gl-preview pre code {
    background: none;
    color: inherit;
    padding: 0;
}
.gl-preview blockquote {
    border-left: 4px solid var(--arch-blue-light);
    padding-left: 14px;
    color: #6b7a99;
    margin-left: 0;
}
.gl-preview hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5em 0;
}
.gl-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    font-size: 0.88rem;
}
.gl-preview th, .gl-preview td {
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.gl-preview th {
    background: #f0f4f8;
    font-weight: 700;
    color: #1a2741;
}

/* unsaved dot */
.unsaved-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    margin-left: 6px;
    vertical-align: middle;
}
