/* ========================================== */
/* GLOBAL VARIABLES & RESET                   */
/* ========================================== */
:root {
    --bg-dark-base: #121212;
    --bg-dark-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-gold: #d4af37;
}

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

body {
    font-family: 'Inter', sans-serif;
}

.hidden {
    display: none !important;
}

/* ========================================== */
/* AUTHENTICATION DESIGN SYSTEM               */
/* ========================================== */
body.auth-page {
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-wrapper {
    display: flex;
    background-color: var(--bg-dark-card);
    border: 1px solid #262626;
    border-radius: 12px;
    width: 800px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}

.brand-panel {
    flex: 1;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
    border-right: 1px solid #262626;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.accent-text {
    color: var(--accent-gold);
}

.brand-tagline {
    color: var(--text-secondary);
}

.form-panel {
    flex: 1;
    padding: 40px;
}

.card-header h2 {
    margin-bottom: 5px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.input-container {
    margin-bottom: 15px;
}

.input-container label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-container input {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    color: var(--text-primary);
}

.input-container input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #b8962e;
}

.switch-view-text {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.switch-view-text a {
    color: var(--accent-gold);
    text-decoration: none;
}

.api-feedback {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
}



/* ========================================== */
/* DASHBOARD DESIGN SYSTEM           */
/* ========================================== */

body.dashboard-page {
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Header Alignment */
.app-header {
    background-color: var(--bg-dark-card);
    border-bottom: 1px solid #262626;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.header-user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#user-welcome {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-logout {
    background: transparent;
    border: 1px solid #404040;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Two-Column Grid Setup */
.dashboard-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    flex: 1;
}

@media (min-width: 992px) {
    .dashboard-container {
        grid-template-columns: 320px 1fr; /* Rigid functional layout control */
    }
}

/* Panel Containers */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-card {
    background-color: var(--bg-dark-card);
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 1.5rem;
}

.panel-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-gold);
    padding-left: 0.5rem;
}

/* Flattened Modern Input Styling */
.input-flat {
    margin-bottom: 0.75rem;
}

.input-flat input {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid #262626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.input-flat input:focus, .search-wrapper input:focus {
    border-color: var(--accent-gold);
}

.search-wrapper input {
    width: 100%;
    background-color: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid #262626;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease;
}

/* Gold Contact Submission Button */
.btn-submit-contact {
    width: 100%;
    background-color: var(--accent-gold);
    color: #000000;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-top: 0.5rem;
}

.btn-submit-contact:hover {
    background-color: #ffcc00;
}

/* Display Canvas (Main Results) */
.dashboard-content {
    display: flex;
    flex-direction: column;
}

.results-card {
    background-color: var(--bg-dark-card);
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.results-header {
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.results-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Placeholder Empty States */
#contact-results-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #262626;
    border-radius: 8px;
    padding: 2rem;
}

.empty-placeholder {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 400px;
    line-height: 1.5;
}

/* Contact Row */
.contact-row {
    padding: 0.85rem 0;
    border-bottom: 1px solid #262626;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 0;
}

.contact-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 200px;
}

.contact-detail {
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 200px;
}

.contact-header .contact-name,
.contact-header .contact-detail {
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 200px;
}

.contact-header {
    border-bottom: 1px solid var(--accent-gold) !important;
    margin-bottom: 0.25rem;
}


/* Edit button — gold outline, matches btn-logout style */
.btn-edit-contact {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.3rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-edit-contact:hover {
    background: var(--accent-gold);
    color: #000;
}

/* Inline edit form — reuses .input-flat from your system */
.inline-edit-form {
    margin-top: 0.75rem;
    background-color: var(--bg-dark-base);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.edit-notes-full {
    grid-column: span 2;
}

/* Edit action buttons */
.edit-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.edit-save-btn {
    width: auto;
    padding: 0.6rem 1.25rem;
    margin-top: 0;
}

.btn-cancel-edit {
    background: transparent;
    border: 1px solid #404040;
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cancel-edit:hover {
    border-color: #666;
    color: var(--text-primary);
}

/* Delete action buttons */
.contact-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.btn-delete-contact {
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
    padding: 0.3rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-delete-contact:hover {
    background: #c0392b;
    color: #fff;
}

/* Accessibility - improve link contrast */
.switch-view-text a {
    color: #f0c040;
    text-decoration: underline;
}
