/* =====================================================
   SISTEMA RESPEL - Estilos Centralizados
   ===================================================== */

/* ==================== RESET Y BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores Principales */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    
    /* Colores de Estado */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --secondary: #6B7280;
    --purple: #8B5CF6;
    --orange: #F97316;
    
    /* Backgrounds */
    --bg-blue: #EFF6FF;
    --bg-green: #ECFDF5;
    --bg-purple: #F5F3FF;
    --bg-orange: #FFF7ED;
    
    /* Grises */
    --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 */
    --header-height: 64px;
    --sidebar-width: 240px;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Tipografía */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html{
    font-family: var(--font-family);
}
body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* ==================== HEADER ==================== */
.header {
    background: white;
    height: var(--header-height);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--gray-600);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 18px;
}

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

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    border-color: var(--primary);
}

.user-avatar, .user-avatar-sm {
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar {
    width: 32px;
    height: 32px;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    margin-right: 12px;
}

.user-name {
    font-weight: 600;
    color: var(--gray-900);
}

.user-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--gray-100);
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 600;
}

.user-role.role-admin {
    background: #FEE2E2;
    color: #991B1B;
}

.user-role.role-user {
    background: #DBEAFE;
    color: #1E40AF;
}

.notifications-dropdown, .user-dropdown {
    position: relative;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    position: relative;
}

.btn-icon:hover {
    background: var(--gray-100);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.dropdown-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.dropdown-body {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    position: absolute;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--box-shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.mobile-menu.show {
    max-height: 500px;
}

.mobile-nav {
    padding: 16px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: var(--gray-700);
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    background: var(--gray-100);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
}

/* ==================== BRANDING UPLOADS ==================== */
.branding-grid .upload-drop {
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.branding-grid .upload-drop:hover {
    border-color: var(--primary);
    box-shadow: var(--box-shadow-lg);
}

.branding-grid .upload-drop.dragging {
    border-color: var(--primary-dark);
    background: #eef2ff;
}

.upload-instructions {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--gray-700);
}

.upload-instructions i {
    font-size: 24px;
    color: var(--primary);
}

.upload-drop input[type="file"] {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 10px;
    background: white;
}

.preview-box {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-box img {
    max-height: 60px;
    max-width: 180px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    padding: 4px;
    background: white;
}

/* ==================== LICENSE TAB ==================== */
.license-card {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.license-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: var(--box-shadow);
}

.license-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.license-value {
    display: block;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.license-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
}

/* ==================== CLIENT PAGE ==================== */
.client-page .client-hero {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    border-radius: 18px;
    padding: 20px 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    box-shadow: var(--box-shadow-lg);
}

.client-page .hero-info h1 {
    margin: 4px 0;
    font-size: 30px;
    font-weight: 800;
}

.client-page .hero-info .sub {
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: white;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.pill-success { background: rgba(16, 185, 129, 0.85); }
.pill-muted { background: rgba(148, 163, 184, 0.8); }

.client-page .card.glass {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--box-shadow);
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-grid.fancy {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.detail-grid.fancy.single {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.detail-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 12px;
}

.detail-item .label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--gray-500);
}

.detail-item .value {
    font-weight: 700;
    color: var(--gray-900);
    margin: 6px 0 2px;
}

.detail-item .hint {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
}

.stat-grid.colorful .stat-card {
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

@media (max-width: 768px) {
    .client-page .client-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .client-page .hero-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    .client-page .hero-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.btn-text-sm {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

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

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==================== CARDS ==================== */
.content-card, .filters-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 24px;
}

.filters-card {
    padding: 20px;
}

.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-actions {
    display: flex;
    gap: 12px;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue { background: var(--bg-blue); }
.bg-green { background: var(--bg-green); }
.bg-purple { background: var(--bg-purple); }
.bg-orange { background: var(--bg-orange); }

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.stat-footer {
    display: flex;
    gap: 6px;
    font-size: 13px;
}

.stat-change {
    font-weight: 600;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

.stat-period {
    color: var(--gray-500);
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.chart-card .card-body {
    height: 300px;
}

.chart-card canvas {
    max-height: 100%;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
}

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

.table thead th {
    background: var(--gray-50);
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

.table-sm tbody td {
    padding: 8px;
}

.table-total {
    background: var(--gray-50);
    font-size: 16px;
}

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

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

.text-muted {
    color: var(--gray-500);
}

/* ==================== FORMS ==================== */
.form-control, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control-sm {
    padding: 6px 8px;
    font-size: 13px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.col-md-3 { flex: 0 0 25%; }
.col-md-4 { flex: 0 0 33.33%; }
.col-md-6 { flex: 0 0 50%; }
.col-md-8 { flex: 0 0 66.66%; }

.form-check-input {
    margin-right: 8px;
}

.form-check-label {
    font-size: 14px;
    color: var(--gray-700);
}

/* Branding & settings refinements */
.branding-grid .form-group {
    background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(99,180,61,0.04));
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

.branding-grid input[type="color"] {
    width: 100%;
    height: 46px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
}

.branding-grid input[type="text"],
.branding-grid input[type="file"] {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
}

.branding-grid .preview-box img {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 6px;
    background: #fff;
}

.form-text {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
    display: block;
}

.form-section {
    padding: 20px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.form-error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    margin-top: 16px;
}

/* ==================== SETTINGS PAGE ==================== */
#smtp-form input,
#smtp-form select,
#app-form input,
#app-form select,
#database-form input,
#database-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #F9FAFB 100%);
    color: var(--gray-800);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(17, 24, 39, 0.06);
}

#company-form input,
#company-form select,
#company-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #F9FAFB 100%);
    color: var(--gray-800);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(17, 24, 39, 0.06);
}

#smtp-form input:focus,
#smtp-form select:focus,
#app-form input:focus,
#app-form select:focus,
#database-form input:focus,
#database-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12), 0 6px 12px rgba(17, 24, 39, 0.06);
    transform: translateY(-1px);
}

#company-form input:focus,
#company-form select:focus,
#company-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12), 0 6px 12px rgba(17, 24, 39, 0.06);
    transform: translateY(-1px);
}

#smtp-form input::placeholder,
#app-form input::placeholder,
#database-form input::placeholder {
    color: var(--gray-400);
}

#company-form input::placeholder,
#company-form textarea::placeholder {
    color: var(--gray-400);
}

#smtp-form small,
#app-form small,
#database-form small {
    display: block;
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
}

#company-form small {
    display: block;
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
}

.form-row textarea{
    padding: 20px;
}

.rt-editor{
    padding: 20px !important;
    max-height: 100px;
    overflow: scroll;
}

/* Company form specific tweaks */
#company-form textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

#company-form .form-group {
    background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(99,180,61,0.04));
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: static;
    top: auto;
    right: auto;
}

/* Badge contador (notificaciones) */
.notifications-dropdown .badge {
    position: absolute;
    top: 2px;
    right: 2px;
}

.badge-primary { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: #F3F4F6; color: #4B5563; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }


.pd10{
    padding: 10px;
    border-radius: 5px;
}
/* ==================== MODALS ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
}

.modal-dialog.modal-lg {
    max-width: 900px;
}

.modal-dialog.modal-xl {
    max-width: 1200px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-card {
    background: white;
    border: 1px solid var(--warning);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 24px;
}

/* ==================== PAGINATION ==================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.pagination-info {
    font-size: 14px;
    color: var(--gray-600);
}

/* ==================== SPINNER ==================== */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.refresh-spin {
    animation: spin 0.85s ease-in-out 1;
    will-change: transform;
}

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

/* ==================== UTILITIES ==================== */
.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

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

.mb-3 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.d-block {
    display: block;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--gray-500);
}

/* ==================== LOGIN PAGE ==================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

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

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-600);
    font-size: 14px;
}

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

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    font-size: 13px;
    color: var(--gray-500);
}

/* ==================== CONTENT GRID ==================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* ==================== TRACKING/EVENTS ==================== */
.tracking-event {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-left: 3px solid var(--primary);
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
}

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

.event-content {
    flex: 1;
}

.event-type {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.event-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.separator {
    margin: 0 6px;
}

/* ==================== DETAIL ROWS ==================== */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

/* ==================== TOP CLIENTS ==================== */
.top-client-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    cursor: pointer;
}

.top-client-item:hover {
    background: var(--gray-50);
}

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

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.client-stats {
    font-size: 12px;
    color: var(--gray-500);
}

.client-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

/* ==================== EXPIRING ITEMS ==================== */
.expiring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--warning);
    border-radius: var(--border-radius);
    background: var(--bg-orange);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.expiring-item:hover {
    background: #FED7AA;
}

.expiring-info strong {
    color: var(--gray-900);
    margin-right: 8px;
}

.expiring-date {
    font-size: 13px;
    color: var(--orange);
    font-weight: 600;
}

/* ==================== ACTIVITY FEED ==================== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-left: 2px solid var(--gray-200);
    margin-bottom: 8px;
}

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

.activity-text {
    color: var(--gray-900);
    margin-bottom: 4px;
}

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

/* ==================== STATS LIST ==================== */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

/* ==================== USER INFO ==================== */
.user-info {
    display: flex;
    align-items: center;
}

.icon-chevron {
    font-size: 10px;
    margin-left: 4px;
}

.icon-eye {
    font-size: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

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

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

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

    .form-row {
        flex-direction: column;
    }

    .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        flex: 0 0 100%;
    }

    .table-container {
        font-size: 12px;
    }

    .main-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .header-title {
        display: none;
    }

    .login-box {
        padding: 24px;
    }
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
    padding: 0 4px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-btn i {
    font-size: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== FORM ROWS ==================== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ==================== ALERT VARIANTS ==================== */
.alert-warning {
    background: var(--bg-orange);
    border-color: var(--orange);
    color: #92400e;
}

.alert-warning i {
    color: var(--orange);
}
