/* ============================================
   HOWDY SYNDICATION — Global Styles
   ============================================ */

:root {
    --accent: #10B1B5;
    --accent-light: #4cb5aa;
    --accent-dark: #0f7d6d;
    --header-bg: #0F070F;
    --header-text: #ffffff;
    --body-bg: #f5f6f8;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Unbounded', sans-serif;
    --font-ui: 'Space Grotesk', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--header-bg);
    color: var(--header-text);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--header-text);
}

.header-logo {
    height: 24px;
    width: auto;
}

.header-brand {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.header-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(16,177,181,0.15);
}

.user-name {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-ui);
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-md { padding: 10px 20px; font-size: 0.9rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--text-primary);
}
.btn-secondary:hover { background: #d1d5db; }

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #059669; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--accent); background: rgba(16,177,181,0.08); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== MAIN CONTENT ===== */
.app-content {
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    padding: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16,177,181,0.12);
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 4px;
}

/* ===== TAG SELECTOR ===== */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-option {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    background: #fff;
    color: var(--text-secondary);
    transition: all 0.2s;
    user-select: none;
}

.tag-option:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tag-option.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== CHECKBOX / TOGGLE ===== */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.card-body {
    padding: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover {
    background: rgba(16,177,181,0.03);
}

/* ===== BADGES ===== */
.badge {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-active { background: rgba(16,185,129,0.12); color: #059669; }
.badge-archived { background: rgba(107,114,128,0.12); color: #6b7280; }
.badge-pending { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-approved { background: rgba(16,185,129,0.12); color: #059669; }
.badge-rejected { background: rgba(239,68,68,0.12); color: #dc2626; }

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--accent); }
.toast-warning { background: var(--warning); color: var(--text-primary); }

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

/* ===== LOADING ===== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

/* ===== TABS ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== PAGE CONTAINERS ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .site-header { padding: 0 16px; }
    .header-nav { display: none; }
    .page-container, .page-container-wide { padding: 20px 16px; }
    .modal { width: 95%; }
    .data-table { font-size: 0.82rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
}
