/* Wise Agency Hub - Complete Styling */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

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

:root {
    --wise-blue: #0d05ec;
    --wise-blue-dark: #0902b8;
    --wise-blue-light: #3d35f5;
    --wise-graphite: #111827;
    --wise-mist: #f4f7fb;
    --wise-white: #ffffff;
    --wise-yellow: #ffe066;
    --wise-gray: #6b7280;
    --wise-gray-light: #9ca3af;
    --wise-border: #e7edf7;
    --wise-radius-sm: 16px;
    --wise-radius: 24px;
    --wise-radius-lg: 32px;
    --wise-radius-xl: 36px;
    --wise-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --wise-font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--wise-font);
    background: var(--wise-mist);
    color: var(--wise-graphite);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* AUTH SCREEN */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wise-blue) 0%, var(--wise-blue-dark) 100%);
    padding: 2rem;
}

.auth-container {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: var(--wise-radius-xl);
    box-shadow: 0 20px 60px rgba(13, 5, 236, 0.3);
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.wise-logo-mark {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--wise-blue), var(--wise-blue-light));
    border-radius: var(--wise-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}

.wise-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--wise-graphite);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--wise-graphite);
}

.form-input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--wise-border);
    border-radius: var(--wise-radius-sm);
    font-family: var(--wise-font);
    font-size: 15px;
    transition: all 0.2s var(--wise-ease);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--wise-blue);
    box-shadow: 0 0 0 4px rgba(13, 5, 236, 0.1);
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--wise-radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* BUTTONS */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--wise-radius-sm);
    font-family: var(--wise-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--wise-ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--wise-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--wise-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 5, 236, 0.3);
}

.btn-secondary {
    background: var(--wise-mist);
    color: var(--wise-graphite);
}

.btn-secondary:hover {
    background: var(--wise-border);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--wise-blue);
    padding: 0;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--wise-font);
}

.btn-link:hover {
    text-decoration: underline;
}

/* DASHBOARD SCREEN */
.dashboard-screen {
    display: flex;
    min-height: 100vh;
    background: var(--wise-mist);
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--wise-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--wise-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-header .wise-logo-mark {
    width: 44px;
    height: 44px;
    font-size: 20px;
    margin: 0;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wise-graphite);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--wise-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s var(--wise-ease);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--wise-mist);
    color: var(--wise-blue);
}

.sidebar-link.active {
    background: var(--wise-mist);
    color: var(--wise-blue);
    border-left-color: var(--wise-blue);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 20px;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--wise-border);
}

.sidebar-user {
    display: flex;
    gap: 0.875rem;
    align-items: center;
}

.sidebar-user-avatar {
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--wise-blue);
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--wise-graphite);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
    min-height: 100vh;
}

.view-section {
    display: none;
}

.view-section:first-child {
    display: block;
}

/* PAGE HEADER */
.page-header {
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--wise-graphite);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 16px;
    color: var(--wise-gray);
}

/* TELEMETRY CARDS */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.telemetry-card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--wise-radius);
    border: 1px solid var(--wise-border);
    transition: all 0.2s var(--wise-ease);
}

.telemetry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 5, 236, 0.08);
}

.telemetry-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--wise-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.telemetry-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--wise-blue);
    line-height: 1;
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--wise-radius);
    border: 1px solid var(--wise-border);
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--wise-gray);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--wise-graphite);
}

/* CONTENT CARD */
.content-card {
    background: white;
    padding: 2rem;
    border-radius: var(--wise-radius);
    border: 1px solid var(--wise-border);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wise-graphite);
    margin-bottom: 1.5rem;
}

/* ACTIVITY FEED */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--wise-radius-sm);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--wise-mist);
}

.activity-icon {
    font-size: 24px;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--wise-graphite);
    margin-bottom: 0.25rem;
}

.activity-meta {
    font-size: 13px;
    color: var(--wise-gray);
}

/* SITES GRID */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.site-card {
    background: white;
    border: 1px solid var(--wise-border);
    border-radius: var(--wise-radius);
    overflow: hidden;
    transition: all 0.2s var(--wise-ease);
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(13, 5, 236, 0.12);
}

.site-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--wise-border);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.site-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wise-graphite);
    margin: 0;
}

.site-card-body {
    padding: 1.5rem;
}

.site-card-meta {
    font-size: 13px;
    color: var(--wise-gray);
    margin-bottom: 0.5rem;
}

.site-card-actions {
    padding: 1rem 1.5rem;
    background: var(--wise-mist);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-active, .badge-staging {
    background: #ecfdf5;
    color: #047857;
}

.badge-inactive {
    background: #fef2f2;
    color: #991b1b;
}

.badge-queued {
    background: #fffbeb;
    color: #92400e;
}

.badge-running {
    background: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background: #ecfdf5;
    color: #047857;
}

.badge-failed {
    background: #fef2f2;
    color: #991b1b;
}

/* TABLES */
.table-container {
    background: white;
    border-radius: var(--wise-radius);
    border: 1px solid var(--wise-border);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--wise-mist);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--wise-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--wise-border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--wise-border);
    font-size: 14px;
    color: var(--wise-graphite);
}

.data-table tbody tr:hover {
    background: var(--wise-mist);
}

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

/* EMPTY STATE */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--wise-gray);
    font-size: 15px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s var(--wise-ease);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .telemetry-grid, .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
    }
}
