/* =========================================
   TELEKOS CRM - Design System
   Colors: Navy #1E2A4A, Orange #F47920
   ========================================= */

/* CSS Variables */
:root {
    /* Brand Colors */
    --primary: #1E2A4A;
    --primary-light: #2d3d5e;
    --primary-dark: #141c32;
    --accent: #F47920;
    --accent-light: #ff9248;
    --accent-dark: #d66510;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Neutrals */
    --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;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.2s ease;
}

/* Dark Mode Variables */
.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --card-bg: #1e293b;
}

/* Light Mode Variables */
.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* =========================================
   PREMIUM TABLES (Glassmorphism)
   ========================================= */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.table tbody tr {
    transition: all 0.2s ease;
    background: transparent;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    transform: scale(1.002);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10;
    position: relative;
}

.table tbody td {
    padding: 16px;
    vertical-align: middle;
    color: var(--text-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

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

/* Typography in Tables */
.fw-bold {
    font-weight: 600;
    color: #ffffff !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Badges & Status */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-gray {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    /* Emerald 400 */
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-active::before {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    /* Red 400 */
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-inactive::before {
    background: #ef4444;
}

/* Buttons in Table */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(244, 121, 32, 0.4);
    /* Brand orange glow */
}

/* Headings Upgrade */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--text-primary) !important;
}

input,
select,
textarea {
    color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color);
}

.card,
.content-card {
    background-color: var(--card-bg);
    color: var(--text-primary);
}


/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.logo-k {
    color: var(--accent);
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.collapsed~.main-wrapper {
    margin-left: var(--sidebar-collapsed);
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 20px;
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* =========================================
   PAGE COMPONENTS
   ========================================= */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.kpi-card.highlight {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
}

.kpi-card.highlight .kpi-value,
.kpi-card.highlight .kpi-label {
    color: white;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-icon.customers {
    background: rgba(99, 102, 241, 0.1);
}

.kpi-icon.lines {
    background: rgba(16, 185, 129, 0.1);
}

.kpi-icon.extensions {
    background: rgba(245, 158, 11, 0.1);
}

.kpi-icon.billing {
    background: rgba(255, 255, 255, 0.2);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

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

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

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

.card-content {
    padding: 16px 20px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-medium {
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.status-badge.default {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Force horizontal actions */
.action-buttons-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 0;
}

.btn-back:hover {
    color: var(--accent);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

/* Client List */
.client-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.client-item:hover {
    background: var(--bg-primary);
}

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

.client-info {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 500;
    color: var(--text-primary);
}

.client-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Services Chart */
.services-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-bar-item {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    align-items: center;
    gap: 16px;
}

.service-name {
    font-weight: 500;
    color: var(--text-primary);
}

.service-bar {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
}

.service-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 12px;
    transition: width 0.5s ease;
}

.service-count {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--primary-light), var(--primary-dark));
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Background decorative circles */
.login-container::before,
.login-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.3;
}

.login-container::before {
    background: var(--accent);
    top: -150px;
    right: -100px;
}

.login-container::after {
    background: var(--info);
    bottom: -150px;
    left: -100px;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #ffffff !important;
    margin-bottom: 8px;
}

.login-header .logo-text .logo-k {
    color: var(--accent) !important;
}

.login-header p {
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.8rem;
    opacity: 0.8;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    /* Lighter labels */
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: #ffffff;
    /* Forced white for better contrast */
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(244, 121, 32, 0.1);
    color: #ffffff;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover:not(:disabled) {
    background: var(--accent-dark);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ff8a8a;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--accent);
    /* Brand color for icons */
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 5;
}

.input-container input {
    padding-left: 48px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    /* Force white text */
}

.input-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-container input:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(244, 121, 32, 0.1) !important;
}

.btn-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

.login-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* =========================================
   CLIENT DETAIL
   ========================================= */
.client-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.detail-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    /* Forced white title */
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item p {
    font-size: 0.95rem;
    color: #ffffff;
    /* Forced white value */
    font-weight: 500;
}

.info-item span {
    font-weight: 500;
    color: var(--text-primary);
}

.contact-section {
    margin-bottom: 16px;
}

.contact-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item .badge {
    font-size: 0.7rem;
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

/* =========================================
   UTILITIES
   ========================================= */
.loading-container,
.error-container,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.btn-page {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Search Input */
.search-input input {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    min-width: 250px;
}

.search-input input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Loading App Screen */
.loading-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content .logo-text {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

.loading-content .spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    margin: 0 auto 16px;
}

/* Empty Layout */
.empty-layout {
    min-height: 100vh;
}

/* 404 Page */
.not-found {
    text-align: center;
    padding: 80px 20px;
}

.not-found h1 {
    font-size: 6rem;
    color: var(--accent);
    margin-bottom: 16px;
}

/* Blazor Error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 16px;
    background: var(--danger);
    color: white;
    text-align: center;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .nav-text,
    .sidebar .logo-text {
        display: none;
    }

    .main-wrapper {
        margin-left: var(--sidebar-collapsed);
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid,
    .client-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Sub-menu */
.nav-sub-item {
    padding-left: 48px !important;
    font-size: 0.85rem !important;
    opacity: 0.7;
    margin-top: -5px;
}

.nav-sub-item:hover {
    opacity: 1;
}

.nav-sub-item .nav-icon {
    font-size: 0.7rem !important;
    margin-right: 12px;
}

.sidebar.collapsed .nav-sub-item {
    display: none;
}

/* Configurador Table Widths */
.price-col {
    width: 140px !important;
}

.qty-col {
    width: 90px !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}