/* ══════════════════════════════════════════════
   Shared Styles — Common across all pages
   Professional White SaaS Theme
   ══════════════════════════════════════════════ */

/* ─── Page Layout ─────────────────────────── */
.page-container {
    position: relative;
    z-index: 1;
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 32px 60px;
}

/* ─── Shared Nav Tabs (cross-page) ─────────── */
.site-nav {
    position: sticky;
    top: 62px;
    z-index: 90;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
}

.site-nav-content {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.site-nav-content::-webkit-scrollbar {
    display: none;
}

.site-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-base);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    position: relative;
}

.site-nav-link:hover {
    color: var(--text-secondary);
}

.site-nav-link.active {
    color: var(--accent-violet);
    border-bottom-color: var(--accent-violet);
    font-weight: 600;
}

.site-nav-link svg {
    flex-shrink: 0;
}

.site-nav-badge {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

/* ─── Page Header ──────────────────────────── */
.page-header {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease forwards;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ─── Glass Card (now solid white) ─────────── */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-base);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    box-shadow: var(--shadow-sm);
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* ─── Form Styles ──────────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-field-input,
.form-field-select,
.form-field-textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-base);
}

.form-field-input:focus,
.form-field-select:focus,
.form-field-textarea:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-field-input::placeholder,
.form-field-textarea::placeholder {
    color: var(--text-muted);
}

.form-field-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8ba3' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-field-select option {
    background: #ffffff;
    color: var(--text-primary);
}

/* ─── Searchable Dropdown ──────────────────── */
.searchable-dropdown {
    position: relative;
}

.searchable-dropdown-input {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-base);
}

.searchable-dropdown-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.searchable-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--accent-violet);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    z-index: 999;
    display: none;
    max-height: 240px;
    overflow-y: auto;
}

.searchable-dropdown.open .searchable-dropdown-list {
    display: block;
    animation: dropdownIn 0.2s ease;
}

.searchable-dropdown-item {
    padding: 9px 14px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.searchable-dropdown-item:hover,
.searchable-dropdown-item.highlighted {
    background: rgba(99, 102, 241, 0.06);
    color: var(--text-primary);
}

.searchable-dropdown-item.add-new {
    color: var(--accent-violet);
    font-weight: 600;
    border-top: 1px solid var(--border);
}

.searchable-dropdown-item.add-new::before {
    content: '+ ';
}

/* ─── Buttons ──────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 100px;
    background: var(--gradient-primary);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-secondary:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet);
    background: rgba(99, 102, 241, 0.04);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(225, 29, 72, 0.2);
    border-radius: 100px;
    background: rgba(225, 29, 72, 0.05);
    color: var(--accent-rose);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-danger:hover {
    background: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.35);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet);
    background: rgba(99, 102, 241, 0.04);
}

/* ─── Status Badge ─────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Data Table ───────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-secondary);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f2f5;
    vertical-align: top;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Empty State ──────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 32px;
    color: var(--text-muted);
    animation: fadeInUp 0.5s ease forwards;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--accent-violet);
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* ─── Toast Notifications ──────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    animation: toastIn 0.3s ease forwards;
    min-width: 280px;
    max-width: 420px;
}

.toast.toast-success {
    border-left: 3px solid var(--accent-emerald);
}

.toast.toast-error {
    border-left: 3px solid var(--accent-rose);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon {
    color: var(--accent-emerald);
}

.toast.toast-error .toast-icon {
    color: var(--accent-rose);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(12px) scale(0.9); }
}

/* ─── Modal ────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 28px 28px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Loading Spinner ──────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: var(--accent-violet);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
}

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 60px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

/* ─── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .page-container {
        padding: 16px;
    }

    .site-nav {
        padding: 0 16px;
    }

    .glass-card {
        padding: 20px;
    }
}
