/**
 * VeroBot Admin Platform - Main Stylesheet
 * Modular structure with sidebar
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors - Sage Green Theme */
    --sage-50: #f6f7f6;
    --sage-100: #e8ebe8;
    --sage-200: #d1d7d1;
    --sage-300: #a8b5a8;
    --sage-400: #7e937e;
    --sage-500: #5a6f5a;
    --sage-600: #475947;
    --sage-700: #364536;
    --sage-800: #283328;
    --sage-900: #1a221a;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    /* Borders */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gray-50);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== HEADER (Top Bar) ==================== */
.header {
    background: var(--white);
    border-bottom: 2px solid var(--sage-300);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.header h1 {
    color: var(--sage-600);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.nav-menu a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--sage-600);
}

/* ==================== LAYOUT (Modular: Left + Right) ==================== */
.main-body {
    display: flex;
    min-height: calc(100vh - 65px);
}

.left-panel {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border-light);
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.left-panel h3 {
    color: var(--sage-600);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-menu li a:hover {
    background: var(--sage-50);
    color: var(--sage-600);
    padding-left: 1rem;
}

.right-content {
    flex: 1;
    padding: 2rem;
    background: var(--gray-50);
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    color: var(--sage-700);
    font-size: 2rem;
    font-weight: 700;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--sage-500);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--sage-600);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-items {
    background: var(--sage-100);
    color: var(--sage-700);
}

.btn-items:hover {
    background: var(--sage-200);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card h3 {
    color: var(--sage-600);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.card hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1rem 0;
}

.filter-card {
    background: var(--sage-50);
    border-color: var(--sage-200);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(90, 111, 90, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.filter-form {
    padding: 0;
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-group .form-control {
    flex: 1;
    max-width: 300px;
}

/* ==================== TABLES ==================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-medium);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==================== BADGES ==================== */
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-trial {
    background: #dbeafe;
    color: #1e40af;
}

.status-suspended {
    background: #fef3c7;
    color: #92400e;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--sage-300);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sage-600);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==================== GRID LAYOUTS ==================== */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    gap: 1rem;
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* ==================== UTILITIES ==================== */
.mt-4 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-body {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group .form-control {
        max-width: none;
    }
}

/* ==================== PARTNER PANEL NAVBAR ==================== */
.navbar {
    background: var(--white);
    border-bottom: 2px solid var(--sage-300);
    padding: 0 2rem;
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.navbar-left-group {
    display: flex;
    align-items: center;
    gap: 3rem;
    height: 100%;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sage-700);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-brand span {
    color: var(--sage-500);
    margin-left: 5px;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    height: 100%;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    padding: 0 0.5rem;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--sage-600);
    background-color: var(--sage-50);
}

.nav-link.active {
    color: var(--sage-700);
    border-bottom-color: var(--sage-500);
    background-color: var(--sage-50);
}

.navbar-right {
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--sage-700);
}

.btn-logout {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.2s;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Layout Fix for No Sidebar */
.main-body.no-sidebar .right-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}