/* ==============================================================
   Huntly Business Portal Styles
   Extends global site.css with forms, tables and dashboards
============================================================== */
@import url('../site.css');

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Auth Screen ── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.08) 0%, var(--bg) 60%);
}

.auth-card {
    position: relative;
    background: var(--panel);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 450px;
}

.logo-header {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    margin-bottom: 24px;
    background: var(--bg);
    border-radius: 12px;
    padding: 6px;
    border: 1px solid var(--border2);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.3s;
    font-size: 14px;
}

.tab.active {
    background: var(--panel2);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px;
    background: var(--bg);
    border: 1.5px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--border2);
}

/* ── Messages ── */
.message {
    margin-top: 20px;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: none;
    font-weight: 500;
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

.message.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

.hidden {
    display: none !important;
}

/* ── Dashboard Layout ── */
.dash-container {
    padding-top: 32px;
    padding-bottom: 80px;
}

.header {
    background: rgba(11, 18, 35, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
}

.header p {
    color: var(--muted);
    font-size: 14px;
}

/* ── Dashboard Cards & Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius);
    text-align: left;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.stat-card:hover {
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.1);
}

.stat-card h3 {
    font-size: 12px;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.1;
}

.stat-card .change {
    font-size: 13px;
    color: var(--green);
    font-weight: 500;
}

.stat-card .change.negative {
    color: #f87171;
}

/* ── Tables ── */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg2);
}

th,
td {
    text-align: left;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

tr:hover td {
    background: var(--bg2);
}

td {
    color: var(--text);
    font-size: 14px;
}

/* ── Badges Override B2B ── */
.badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge.paused {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.pending {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge.rejected {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ── Secondary Button ── */
.btn-secondary {
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--border2);
}

.btn-secondary:hover {
    background: var(--border2);
    border-color: var(--muted);
    transform: translateY(-2px);
}

/* ── Chart & empty states ── */
.chart-container {
    height: 320px;
    position: relative;
    width: 100%;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-size: 14px;
}

/* ── Create Campaign ── */
.card-form {
    max-width: 720px;
    margin: 0 auto;
}

.map-container {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-card {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    overflow: hidden;
}

.image-upload-box {
    border: 2px dashed var(--border2);
    padding: 48px 24px;
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.image-upload-box:hover {
    border-color: var(--green);
    background: rgba(34, 197, 94, 0.05);
}

.date-range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lang-select {
    width: auto;
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--panel2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.lang-select:hover {
    border-color: var(--muted);
}

.lang-select option {
    background: var(--panel);
    color: var(--text);
}

.review-note {
    font-size: 12px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 6px;
    border-left: 3px solid #ef4444;
}

/* Action button row */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
}