/* AuthGate - Microsoft Fluent Design System */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600;700&display=swap');

:root {
    /* Fluent Design Tokens */
    --f-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --f-bg: #F5F5F5;
    --f-surface: #FFFFFF;
    --f-surface-secondary: #FAFAFA;
    --f-primary: #0078D4;
    --f-primary-hover: #106EBE;
    --f-primary-active: #005A9E;
    --f-danger: #D13438;
    --f-danger-hover: #A4262C;
    --f-success: #107C10;
    --f-warning: #FFB900;
    --f-info: #0078D4;
    --f-text: #323130;
    --f-text-secondary: #605E5C;
    --f-text-tertiary: #A19F9D;
    --f-text-on-primary: #FFFFFF;
    --f-border: #EDEBE9;
    --f-border-strong: #C8C6C4;
    --f-shadow-4: 0 1.6px 3.6px rgba(0,0,0,.132), 0 0.3px 0.9px rgba(0,0,0,.108);
    --f-shadow-8: 0 3.2px 7.2px rgba(0,0,0,.132), 0 0.6px 1.8px rgba(0,0,0,.108);
    --f-shadow-16: 0 6.4px 14.4px rgba(0,0,0,.132), 0 1.2px 3.6px rgba(0,0,0,.108);
    --f-shadow-64: 0 25.6px 57.6px rgba(0,0,0,.22), 0 4.8px 14.4px rgba(0,0,0,.18);
    --f-radius: 4px;
    --f-radius-lg: 8px;
    --f-radius-xl: 12px;
    --f-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --f-nav-width: 260px;
    --f-header-height: 48px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--f-font);
    background: var(--f-bg);
    color: var(--f-text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--f-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.ag-layout {
    display: flex;
    min-height: 100vh;
}

/* Side Navigation */
.ag-nav {
    width: var(--f-nav-width);
    background: #FAF9F8;
    border-right: 1px solid var(--f-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--f-transition);
}

.ag-nav-brand {
    height: var(--f-header-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--f-border);
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--f-text);
}

.ag-nav-brand img { height: 24px; width: auto; }
.ag-nav-brand .ag-brand-icon {
    width: 28px; height: 28px;
    background: var(--f-primary);
    color: white;
    border-radius: var(--f-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.ag-nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.ag-nav-section {
    padding: 4px 12px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--f-text-tertiary);
}

.ag-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    margin: 1px 8px;
    border-radius: var(--f-radius);
    color: var(--f-text);
    font-size: 13px;
    gap: 10px;
    cursor: pointer;
    transition: background var(--f-transition);
    text-decoration: none;
}

.ag-nav-item:hover { background: #F3F2F1; text-decoration: none; }
.ag-nav-item.active { background: #EFF6FC; color: var(--f-primary); font-weight: 600; }
.ag-nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; opacity: 0.8; }
.ag-nav-item.active .nav-icon { opacity: 1; }

.ag-nav-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--f-border);
    font-size: 12px;
    color: var(--f-text-tertiary);
}

/* Main Content */
.ag-main {
    flex: 1;
    margin-left: var(--f-nav-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Bar */
.ag-header {
    height: var(--f-header-height);
    background: var(--f-surface);
    border-bottom: 1px solid var(--f-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.ag-header-left { display: flex; align-items: center; gap: 12px; }
.ag-header-right { display: flex; align-items: center; gap: 12px; }

.ag-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    color: var(--f-text);
}

.ag-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--f-text-secondary);
}

.ag-header-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--f-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Content Area */
.ag-content {
    flex: 1;
    padding: 24px;
}

.ag-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ag-page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--f-text);
    line-height: 1.2;
}

.ag-page-subtitle {
    font-size: 13px;
    color: var(--f-text-secondary);
    margin-top: 4px;
}

/* ============================================================
   CARDS
   ============================================================ */
.ag-card {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-lg);
    box-shadow: var(--f-shadow-4);
}

.ag-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--f-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ag-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--f-text);
}

.ag-card-body { padding: 20px; }
.ag-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--f-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Stat Cards */
.ag-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ag-stat-card {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-lg);
    padding: 20px;
    box-shadow: var(--f-shadow-4);
}

.ag-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--f-text-secondary);
    margin-bottom: 8px;
}

.ag-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--f-text);
    line-height: 1;
}

.ag-stat-meta {
    font-size: 12px;
    color: var(--f-text-tertiary);
    margin-top: 6px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.ag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    font-family: var(--f-font);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--f-radius);
    cursor: pointer;
    transition: all var(--f-transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.5;
}

.ag-btn:hover { text-decoration: none; }

.ag-btn-primary {
    background: var(--f-primary);
    color: var(--f-text-on-primary);
    border-color: var(--f-primary);
}
.ag-btn-primary:hover { background: var(--f-primary-hover); border-color: var(--f-primary-hover); }

.ag-btn-default {
    background: var(--f-surface);
    color: var(--f-text);
    border-color: var(--f-border-strong);
}
.ag-btn-default:hover { background: #F3F2F1; }

.ag-btn-danger {
    background: var(--f-danger);
    color: white;
    border-color: var(--f-danger);
}
.ag-btn-danger:hover { background: var(--f-danger-hover); }

.ag-btn-subtle {
    background: transparent;
    color: var(--f-text);
    border-color: transparent;
}
.ag-btn-subtle:hover { background: #F3F2F1; }

.ag-btn-sm { padding: 4px 10px; font-size: 12px; }
.ag-btn-lg { padding: 10px 24px; font-size: 15px; }
.ag-btn-icon { padding: 6px; min-width: 32px; }

.ag-btn:disabled, .ag-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ag-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   FORMS
   ============================================================ */
.ag-form-group {
    margin-bottom: 16px;
}

.ag-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--f-text);
    margin-bottom: 6px;
}

.ag-label-hint {
    font-weight: 400;
    color: var(--f-text-tertiary);
    font-size: 12px;
}

.ag-input, .ag-select, .ag-textarea {
    width: 100%;
    padding: 6px 12px;
    font-family: var(--f-font);
    font-size: 14px;
    color: var(--f-text);
    background: var(--f-surface);
    border: 1px solid var(--f-border-strong);
    border-radius: var(--f-radius);
    transition: border-color var(--f-transition), box-shadow var(--f-transition);
    outline: none;
}

.ag-input:focus, .ag-select:focus, .ag-textarea:focus {
    border-color: var(--f-primary);
    box-shadow: 0 0 0 1px var(--f-primary);
}

.ag-input.error, .ag-select.error, .ag-textarea.error {
    border-color: var(--f-danger);
}

.ag-textarea { min-height: 80px; resize: vertical; }

.ag-select { appearance: none; cursor: pointer; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23605E5C' d='M6 8.825L1.175 4l.7-.7L6 7.4l4.125-4.1.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ag-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ag-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--f-primary);
    cursor: pointer;
}

.ag-form-help {
    font-size: 12px;
    color: var(--f-text-tertiary);
    margin-top: 4px;
}

.ag-form-error {
    font-size: 12px;
    color: var(--f-danger);
    margin-top: 4px;
}

.ag-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ag-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--f-border);
    margin-top: 16px;
}

/* ============================================================
   TABLES
   ============================================================ */
.ag-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-lg);
    background: var(--f-surface);
}

.ag-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ag-table th {
    padding: 10px 16px;
    font-weight: 600;
    text-align: left;
    background: var(--f-surface-secondary);
    color: var(--f-text-secondary);
    border-bottom: 1px solid var(--f-border);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ag-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--f-border);
    vertical-align: middle;
}

.ag-table tr:last-child td { border-bottom: none; }
.ag-table tr:hover td { background: #FAF9F8; }

.ag-table .cell-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ============================================================
   CHIPS & BADGES
   ============================================================ */
.ag-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    gap: 4px;
    white-space: nowrap;
}

.ag-chip-default { background: #F3F2F1; color: var(--f-text-secondary); }
.ag-chip-primary { background: #DEECF9; color: #0078D4; }
.ag-chip-success { background: #DFF6DD; color: #107C10; }
.ag-chip-warning { background: #FFF4CE; color: #797673; }
.ag-chip-danger { background: #FDE7E9; color: #D13438; }
.ag-chip-info { background: #F3F2F1; color: var(--f-text); }

.ag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--f-primary);
    color: white;
}

/* ============================================================
   AVATAR
   ============================================================ */
.ag-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.ag-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.ag-avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.ag-avatar-xl { width: 72px; height: 72px; font-size: 28px; }

/* ============================================================
   TABS
   ============================================================ */
.ag-tabs {
    display: flex;
    border-bottom: 1px solid var(--f-border);
    margin-bottom: 20px;
    overflow-x: auto;
    gap: 0;
}

.ag-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--f-text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--f-transition);
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--f-font);
}

.ag-tab:hover { color: var(--f-text); text-decoration: none; }
.ag-tab.active { color: var(--f-primary); border-bottom-color: var(--f-primary); font-weight: 600; }

.ag-tab-content { display: none; }
.ag-tab-content.active { display: block; }

/* ============================================================
   ALERTS & MESSAGES
   ============================================================ */
.ag-alert {
    padding: 12px 16px;
    border-radius: var(--f-radius);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.ag-alert-success { background: #DFF6DD; color: #107C10; border: 1px solid #C3E6CB; }
.ag-alert-danger { background: #FDE7E9; color: #D13438; border: 1px solid #F1C0C0; }
.ag-alert-warning { background: #FFF4CE; color: #7A7574; border: 1px solid #FFE7A0; }
.ag-alert-info { background: #F0F6FF; color: #0078D4; border: 1px solid #C7E0F4; }

.ag-alert .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   DIALOG / MODAL
   ============================================================ */
.ag-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 200ms ease;
}

.ag-dialog-overlay.active { opacity: 1; visibility: visible; }

.ag-dialog {
    background: var(--f-surface);
    border-radius: var(--f-radius-lg);
    box-shadow: var(--f-shadow-64);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 200ms ease;
}

.ag-dialog-overlay.active .ag-dialog { transform: translateY(0); }

.ag-dialog-header {
    padding: 20px 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ag-dialog-title { font-size: 18px; font-weight: 600; }

.ag-dialog-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    color: var(--f-text-secondary);
    border-radius: var(--f-radius);
}

.ag-dialog-close:hover { background: #F3F2F1; }

.ag-dialog-body { padding: 0 24px 20px; }
.ag-dialog-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--f-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.ag-tooltip {
    position: relative;
    cursor: help;
}

.ag-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #323130;
    color: white;
    font-size: 12px;
    font-weight: 400;
    border-radius: var(--f-radius);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 150ms ease;
    z-index: 200;
    pointer-events: none;
    max-width: 300px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.ag-tooltip:hover::after { opacity: 1; visibility: visible; }

/* ============================================================
   PAGINATION
   ============================================================ */
.ag-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 13px;
    color: var(--f-text-secondary);
    flex-wrap: wrap;
    gap: 8px;
}

.ag-pagination-pages { display: flex; gap: 4px; }

.ag-pagination .page-link {
    padding: 4px 10px;
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius);
    color: var(--f-text);
    text-decoration: none;
    font-size: 12px;
}

.ag-pagination .page-link:hover { background: #F3F2F1; text-decoration: none; }
.ag-pagination .page-link.active { background: var(--f-primary); color: white; border-color: var(--f-primary); }

/* ============================================================
   FILTERS / TOOLBAR
   ============================================================ */
.ag-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ag-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.ag-search-box input {
    width: 100%;
    padding: 6px 12px 6px 34px;
    border: 1px solid var(--f-border-strong);
    border-radius: var(--f-radius);
    font-size: 13px;
    font-family: var(--f-font);
    outline: none;
}

.ag-search-box input:focus { border-color: var(--f-primary); box-shadow: 0 0 0 1px var(--f-primary); }

.ag-search-box::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.5;
}

.ag-filter-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--f-border-strong);
    border-radius: var(--f-radius);
    font-size: 13px;
    font-family: var(--f-font);
    appearance: none;
    cursor: pointer;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23605E5C' d='M6 8.825L1.175 4l.7-.7L6 7.4l4.125-4.1.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* ============================================================
   SCOPE TREE
   ============================================================ */
.scope-tree { list-style: none; padding-left: 0; }
.scope-tree ul { list-style: none; padding-left: 24px; border-left: 1px solid var(--f-border); margin-left: 12px; }

.scope-node {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--f-radius);
    margin: 2px 0;
}

.scope-node:hover { background: #FAF9F8; }

.scope-node-name { font-weight: 500; font-size: 13px; }
.scope-node-canonical { font-size: 12px; color: var(--f-text-tertiary); font-family: 'Consolas', monospace; }
.scope-node-wildcard { color: var(--f-primary); font-weight: 600; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.ag-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--f-text-secondary);
}

.ag-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.ag-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--f-text); }
.ag-empty-text { font-size: 13px; margin-bottom: 20px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.ag-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--login-bg, #F5F5F5);
}

.ag-login-card {
    background: white;
    border-radius: var(--f-radius-xl);
    box-shadow: var(--f-shadow-16);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.ag-login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.ag-login-logo img { max-height: 40px; width: auto; }

.ag-login-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
    color: var(--login-text, var(--f-text));
}

.ag-login-subtitle {
    font-size: 13px;
    text-align: center;
    margin-bottom: 28px;
    color: var(--f-text-secondary);
}

.ag-login-card .ag-btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    background: var(--login-button, var(--f-primary));
    border-color: var(--login-button, var(--f-primary));
}

.ag-login-card .ag-btn-primary:hover {
    filter: brightness(0.9);
}

.ag-login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--f-text-tertiary);
}

.ag-login-footer a { color: var(--login-link, var(--f-primary)); }

/* ============================================================
   ACCESS DENIED PAGE
   ============================================================ */
.ag-denied-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--f-bg);
}

.ag-denied-card {
    background: white;
    border-radius: var(--f-radius-xl);
    box-shadow: var(--f-shadow-16);
    width: 100%;
    max-width: 480px;
    padding: 48px 40px;
    text-align: center;
}

.ag-denied-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.ag-denied-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--f-text);
}

.ag-denied-text {
    font-size: 14px;
    color: var(--f-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.ag-timeline { list-style: none; padding: 0; }

.ag-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--f-border);
    font-size: 13px;
}

.ag-timeline-item:last-child { border-bottom: none; }

.ag-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--f-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.ag-timeline-dot.warning { background: var(--f-warning); }
.ag-timeline-dot.danger { background: var(--f-danger); }
.ag-timeline-dot.success { background: var(--f-success); }

.ag-timeline-time {
    font-size: 11px;
    color: var(--f-text-tertiary);
    margin-top: 2px;
}

/* ============================================================
   COLOR PICKER / SWATCH
   ============================================================ */
.ag-color-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ag-color-input input[type="color"] {
    width: 36px;
    height: 32px;
    border: 1px solid var(--f-border-strong);
    border-radius: var(--f-radius);
    cursor: pointer;
    padding: 2px;
}

.ag-color-input input[type="text"] {
    width: 100px;
}

/* ============================================================
   PREVIEW FRAME
   ============================================================ */
.ag-preview-frame {
    border: 2px solid var(--f-border);
    border-radius: var(--f-radius-lg);
    overflow: hidden;
    background: #F5F5F5;
}

.ag-preview-toolbar {
    background: #E1DFDD;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--f-text-secondary);
}

.ag-preview-toolbar .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ag-preview-desktop { min-height: 400px; }
.ag-preview-mobile { max-width: 375px; min-height: 600px; margin: 0 auto; }

/* ============================================================
   INSTALLER
   ============================================================ */
.ag-install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #0078D4 0%, #004578 100%);
}

.ag-install-card {
    background: white;
    border-radius: var(--f-radius-xl);
    box-shadow: var(--f-shadow-64);
    width: 100%;
    max-width: 640px;
    overflow: hidden;
}

.ag-install-header {
    padding: 24px 32px;
    background: #FAF9F8;
    border-bottom: 1px solid var(--f-border);
}

.ag-install-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ag-install-header p {
    font-size: 13px;
    color: var(--f-text-secondary);
}

.ag-install-steps {
    display: flex;
    padding: 0 32px;
    background: #FAF9F8;
    border-bottom: 1px solid var(--f-border);
    overflow-x: auto;
    gap: 0;
}

.ag-install-step {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--f-text-tertiary);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--f-transition);
}

.ag-install-step.active { color: var(--f-primary); border-bottom-color: var(--f-primary); }
.ag-install-step.completed { color: var(--f-success); }
.ag-install-step.completed::before { content: '✓ '; }

.ag-install-body { padding: 32px; }

.ag-install-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--f-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ag-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
}

.ag-check-pass { color: var(--f-success); }
.ag-check-fail { color: var(--f-danger); }
.ag-check-icon { font-size: 16px; width: 24px; text-align: center; }

/* ============================================================
   LOADING
   ============================================================ */
.ag-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--f-border);
    border-top-color: var(--f-primary);
    border-radius: 50%;
    animation: ag-spin 0.7s linear infinite;
}

@keyframes ag-spin { to { transform: rotate(360deg); } }

.ag-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--f-text-secondary);
    font-size: 13px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ag-nav {
        transform: translateX(-100%);
    }
    .ag-nav.open { transform: translateX(0); }
    .ag-main { margin-left: 0; }
    .ag-mobile-toggle { display: block; }
    .ag-content { padding: 16px; }
    .ag-page-header { flex-direction: column; align-items: flex-start; }
    .ag-form-row { grid-template-columns: 1fr; }
    .ag-stats { grid-template-columns: 1fr 1fr; }
    .ag-login-card { padding: 24px; }
    .ag-install-card { border-radius: var(--f-radius-lg); }
    .ag-install-body { padding: 20px; }
    .ag-table-wrap { font-size: 12px; }
}

@media (max-width: 480px) {
    .ag-stats { grid-template-columns: 1fr; }
    html { font-size: 13px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted { color: var(--f-text-tertiary); }
.text-danger { color: var(--f-danger); }
.text-success { color: var(--f-success); }
.text-primary { color: var(--f-primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-mono { font-family: 'Consolas', 'Courier New', monospace; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
