/* Aeton Business Portal - Premium Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6B4EFF;
    --primary-dark: #5839EF;
    --secondary: #0D47A1;
    --background: #F4F6F9;
    --surface: #FFFFFF;
    --text-primary: #1A1A2E;
    --text-secondary: #58667E;
    --success: #00C853;
    --warning: #FFAB00;
    --danger: #FF3D00;
    --border: #E0E0E0;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 30px rgba(107, 78, 255, 0.15);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navigation --- */
.navbar {
    background: var(--surface);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand i {
    font-size: 1.1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.avatar-initial {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* --- KPI Cards --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-info h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Specific KPI Colors */
.kpi-impressions .kpi-icon {
    background: rgba(107, 78, 255, 0.1);
    color: var(--primary);
}

.kpi-clicks .kpi-icon {
    background: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

.kpi-spend .kpi-icon {
    background: rgba(255, 171, 0, 0.1);
    color: var(--warning);
}

/* --- Tables --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    /* For rounded corners on table */
    overflow-x: auto;
    /* Horizontal scroll on mobile */
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on small screens */
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #FAFAFA;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #F8F9FA;
}

/* Promo Item Styles */
.promo-title-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.promo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #EEE;
}

.promo-dates {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

.badge-scheduled {
    background: rgba(107, 78, 255, 0.1);
    color: var(--primary);
}

.badge-ended {
    background: rgba(158, 158, 158, 0.1);
    color: #757575;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(107, 78, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 78, 255, 0.4);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* --- Loading --- */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        /* Stack KPIs on mobile */
        gap: 1rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .brand span {
        display: none;
        /* Hide 'Aeton Business' text on small mobile if needed */
    }
}

/* CALENDAR WIDGET (Light Theme) */
.calendar-wrapper {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.calendar-title {
    text-align: center;
    width: 100%;
}

.calendar-title h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
}

.calendar-nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.calendar-nav-btn:hover {
    color: var(--primary);
}

/* GRID */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
}

/* Weekdays */
.weekday-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    padding-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Day Cell */
.day-cell {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70px;
    /* Fixed height for squares */
    position: relative;
    border: 1px solid transparent;
}

.day-cell.empty {
    background: transparent;
    cursor: default;
}

.day-cell:not(.empty):not(.disabled):hover {
    background: #F0F0FF;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 78, 255, 0.1);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.day-price {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* STATES */
.day-cell.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(107, 78, 255, 0.3);
}

.day-cell.selected .day-number,
.day-cell.selected .day-price {
    color: white;
}

/* Contiguous Range */
.day-cell.in-range {
    background: rgba(107, 78, 255, 0.08);
    /* Very light purple */
    border-color: transparent;
}

.day-cell.in-range .day-number {
    color: var(--primary);
}

.day-cell.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #EEEEEE;
    color: #999;
}

.day-cell.weekend .day-price {
    color: var(--warning);
    /* Highlight higher price */
    font-weight: 600;
}

.day-cell.selected.weekend .day-price {
    color: #FFE0B2;
}

.day-cell.today {
    border: 1px solid var(--primary);
}