@font-face {
    font-family: 'Proxima Nova';
    src: url('https://aurea.com/wp-content/themes/aurea-cs-2020/css/fonts/subset-ProximaNova-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Proxima Nova';
    src: url('https://aurea.com/wp-content/themes/aurea-cs-2020/css/fonts/subset-ProximaNova-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: #1b365d;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    color: #fff;
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

#btn-logout {
    padding: 0.3rem 0.7rem;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}

#btn-logout:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    align-self: flex-start;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1a1a2e;
}

/* Product family tabs (top tier) */
.product-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: #f5f7fa;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.product-tab:hover {
    border-color: #307fe2;
    color: #1a1a2e;
}

.product-tab.active {
    background: #1b365d;
    color: #fff;
    border-color: #1b365d;
}

/* Customer / Internal tabs (second tier) */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e8ecf1;
}

.tab {
    flex: 1;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: #1a1a2e; }
.tab.active { color: #1b365d; border-bottom-color: #1b365d; }

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Form elements */
label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #1a1a2e;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

select, input[type="number"], input[type="date"], input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 1rem;
    background: #fff;
    color: #1a1a2e;
}

select:focus, input:focus {
    outline: none;
    border-color: #1b365d;
}

optgroup { font-weight: 700; }

.hint {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Generate button */
.btn-generate {
    width: 100%;
    padding: 0.7rem;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-generate:hover { background: #2d2d4e; }
.btn-generate:active { background: #1a1a2e; }

/* Result */
#result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e8f5e9;
    border-radius: 4px;
}

#result label {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.result-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#control-number {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    word-break: break-all;
    color: #1a1a2e;
}

#btn-copy {
    padding: 0.4rem 0.8rem;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

#btn-copy:hover { background: #1b5e20; }

#btn-download {
    padding: 0.4rem 0.8rem;
    background: #1b365d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

#btn-download:hover { background: #244a7a; }

.pivotal-ready {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    color: #2e7d32;
}

/* Error */
#error {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fce8e8;
    border-radius: 4px;
    color: #d32f2f;
    font-size: 0.9rem;
}

/* Loading */
#loading {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1b365d;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Login page */
.login-container { max-width: 440px; text-align: center; }

.login-header { margin-bottom: 2rem; }

.login-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.login-section { margin-bottom: 0.5rem; }

.login-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
}

.login-section-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.btn-login {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-google:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    border-color: #ccc;
}

.google-icon { flex-shrink: 0; }

.btn-email {
    background: #1b365d;
    color: #fff;
    border: none;
}

.btn-email:hover { background: #244a7a; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #999;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8ecf1;
}

/* Nav links */
.nav-link {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s;
}

.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; font-weight: 700; }

/* Admin container (wider for table) */
.admin-container { max-width: 960px; }

/* Admin filters */
.admin-filters { margin-bottom: 1.5rem; }

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.filter-field {
    flex: 1;
}

.filter-field input,
.filter-field select {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.filter-actions .btn-generate { flex: 1; }

.btn-secondary {
    padding: 0.7rem 1.2rem;
    background: #f5f7fa;
    color: #1a1a2e;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover { background: #e8ecf1; }
.btn-secondary:disabled { opacity: 0.5; cursor: default; }

/* Audit table */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#results-table th,
#results-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e8ecf1;
    white-space: nowrap;
}

#results-table th {
    font-weight: 700;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#results-table tbody tr:hover { background: #f5f7fa; }

.key-cell { cursor: pointer; }
.key-masked { color: #999; }
.key-value { font-family: monospace; font-weight: 700; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-red { background: #fce8e8; color: #d32f2f; }

/* Utility */
.hidden { display: none !important; }
