/* 
========================================
BASE.CSS - FOUNDATION & VARIABLES
========================================
CRM-focused design: Compact, functional, desktop-first
Based on existing mini.css patterns and sizing
*/

/* 
=====================================
CSS RESET & BASE
=====================================
*/
@import 'fonts.css';

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

/* 
=====================================
CSS CUSTOM PROPERTIES (VARIABLES)
=====================================
Keeping your existing compact, functional approach
*/

:root {
    /* Brand Colors - From existing mini.css */
    --color-primary: #00b8cc;
    --color-secondary: #0052a3;
    --color-accent: #4a9eff;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-whatsapp: #25d366;
    --color-info: #3b82f6;

    /* Dark Theme Backgrounds - Existing */
    --color-bg-body: #050514;
    --color-bg-surface: #1a1a2e;
    --color-bg-input: #0f0f1f;
    --color-bg-hover: #2d2d4a;

    /* Text Colors - Existing */
    --color-text-primary: #ffffff;
    --color-text-secondary: #d3d3d3;
    --color-text-muted: #8c8c8c;
    --color-text-on-light: #000000;

    /* Border Colors - Existing */
    --color-border: #2d2d4a;
    --color-border-focus: #4a9eff;

    /* COMPACT SPACING SCALE - CRM Optimized */
    --space-1: 4px;
    /* Tight gaps - table cells, card gaps */
    --space-2: 8px;
    /* Standard card padding, form gaps */
    --space-3: 12px;
    /* Form elements, section spacing */
    --space-4: 16px;
    /* Container padding, major sections */
    --space-5: 20px;
    /* Large container spacing */
    --space-6: 24px;
    /* Page sections */

    /* COMPACT TYPOGRAPHY SCALE */
    --text-xs: 0.75rem;
    /* 12px - Labels, badges, table data */
    --text-sm: 0.875rem;
    /* 14px - Body text, buttons */
    --text-base: 1rem;
    /* 16px - Standard text */
    --text-lg: 1.125rem;
    /* 18px - Section headings */
    --text-xl: 1.25rem;
    /* 20px - Page headings */
    --text-2xl: 1.5rem;
    /* 24px - Main headings */
    --text-3xl: 2.25rem;
    /* 36px - Dashboard numbers */

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Border Radius - Subtle, professional */
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    /* 6px */
    --radius-lg: 0.5rem;
    /* 8px */

    /* Transitions */
    --transition-normal: 200ms ease;
    --transition-fast: 100ms ease;

    /* Component Sizes - Compact for CRM efficiency */
    --size-navbar: 3.8rem;
    /* 60px */
    --size-input: 2.5rem;
    /* 40px */
    --size-button: 2.5rem;
    /* 40px */
    --size-button-sm: 2rem;
    /* 32px - as seen in templates */
    --size-button-xs: 1.5rem;
    /* 24px - table actions */

    /* Table & Data Display */
    --table-row-height: 2.5rem;
    /* 40px - compact rows */
    --table-cell-padding: 0.5rem 0.25rem;
    /* 8px 4px - from existing */
    --table-header-height: 2.25rem;
    /* 36px */

    /* Status Badge Sizes */
    --badge-sm-width: 2rem;
    /* 32px */
    --badge-sm-height: 1.25rem;
    /* 20px */
}

/* 
=====================================
BASE STYLES
=====================================
*/

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: 1.4;
    /* Slightly tighter for data density */
    color: var(--color-text-secondary);
    background-color: var(--color-bg-body);
    text-rendering: optimizeSpeed;
}

:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

/* 
=====================================
TYPOGRAPHY UTILITIES
=====================================
Compact, functional text styles
*/

.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-2xl {
    font-size: var(--text-2xl);
}

.text-3xl {
    font-size: var(--text-3xl);
}

.font-normal {
    font-weight: var(--font-normal);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Text Colors */
.text-primary {
    color: var(--color-text-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-danger {
    color: var(--color-danger);
}

.text-accent {
    color: var(--color-accent);
}

.text-info {
    color: var(--color-info);
}

.text-white {
    color: white;
}

/* 
=====================================
COMPACT SPACING UTILITIES
=====================================
Essential spacing classes for CRM efficiency
*/

/* Padding */
.p-0 {
    padding: 0;
}

.p-1 {
    padding: var(--space-1);
}

.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

.p-5 {
    padding: var(--space-5);
}

.p-6 {
    padding: var(--space-6);
}

/* Margins */
.m-0 {
    margin: 0;
}

.m-1 {
    margin: var(--space-1);
}

.m-2 {
    margin: var(--space-2);
}

.m-3 {
    margin: var(--space-3);
}

.m-4 {
    margin: var(--space-4);
}

.m-5 {
    margin: var(--space-5);
}

.m-6 {
    margin: var(--space-6);
}

/* Margin directional */
.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--space-1);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.ml-1 {
    margin-left: var(--space-1);
}

.ml-2 {
    margin-left: var(--space-2);
}

.ml-3 {
    margin-left: var(--space-3);
}

.mr-1 {
    margin-right: var(--space-1);
}

.mr-2 {
    margin-right: var(--space-2);
}

.mr-3 {
    margin-right: var(--space-3);
}

/* Gap utilities */
.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

/* 
=====================================
LAYOUT UTILITIES
=====================================
Essential layout classes for CRM data display
*/

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.flex-3 {
    flex: 3;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Width utilities */
.w-full {
    width: 100%;
}

.w-16 {
    width: 4rem;
}

/* 64px - as seen in templates */
.min-w-16 {
    min-width: 4rem;
}

/* Background utilities */
.bg-transparent {
    background-color: transparent;
}

/* Border utilities */
.border {
    border: 1px solid var(--color-border);
}

.border-b {
    border-bottom: 1px solid var(--color-border);
}

.border-color {
    border-color: var(--color-border);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-md {
    border-radius: var(--radius-md);
}

/*
=====================================
UTILITY CLASSES
=====================================
Tailwind-style utilities used across templates
*/

/* Spacing: vertical rhythm */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Padding utilities */
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pb-3 { padding-bottom: 0.75rem; }

/* Size utilities */
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }

/* Border utilities */
.rounded-full { border-radius: 9999px; }

/* Background color utilities */
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-danger { background-color: var(--color-danger); }
.bg-info { background-color: var(--color-info); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-whatsapp { background-color: var(--color-whatsapp); }
.bg-opacity-10 { opacity: 0.1; }

/* Display utilities */
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.block { display: block; }

/* Flex utilities */
.min-w-0 { min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }

/* Responsive grid (md: 768px+) */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Responsive grid (lg: 1024px+) */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/*
=====================================
MINIMAL RESPONSIVE (Desktop-First)
=====================================
Very basic responsive for occasional mobile use
*/

@media (max-width: 48rem) {
    :root {
        /* Slightly larger spacing on mobile */
        --space-2: 10px;
        --space-3: 14px;
        --space-4: 18px;

        /* Larger touch targets */
        --size-button: 2.75rem;
        --size-input: 2.75rem;
    }

    .container {
        padding-inline: var(--space-2);
    }
}