/**
 * Admin Panel Styles - Matched with Main Site Theme
 * UTF-8 encoded
 */

/* Admin Color Variables - Using Main Site Theme */
:root {
    /* Font Size Variables */
    --base-font-size: 16px;
    --h1-font-size: 2.5rem;
    --h2-font-size: 2rem;
    --h3-font-size: 1.75rem;
    
    /* Use main site color variables */
    --admin-primary: var(--md-primary, #6366F1);
    --admin-primary-dark: var(--md-primary-dark, #4F46E5);
    --admin-primary-light: var(--md-primary-light, #818CF8);
    --admin-secondary: var(--md-secondary, #3B82F6);
    --admin-tertiary: var(--md-tertiary, #8B5CF6);
    --admin-error: var(--md-error, #EF4444);
    --admin-success: var(--md-success, #10B981);
    --admin-warning: var(--md-warning, #F59E0B);
    --admin-info: var(--md-info, #3B82F6);
    
    --admin-surface: var(--md-surface, #FFFFFF);
    --admin-surface-variant: var(--md-surface-variant, #F9FAFB);
    --admin-background: var(--md-background, #FFFFFF);
    --admin-on-surface: var(--md-on-surface, #1F2937);
    --admin-on-primary: var(--md-on-primary, #FFFFFF);
    
    --admin-elevation-1: var(--md-elevation-1, 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06));
    --admin-elevation-2: var(--md-elevation-2, 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06));
    --admin-elevation-3: var(--md-elevation-3, 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05));
}

/* Dashboard Header - Unified Style */
.dashboard-header {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--admin-elevation-2);
    transition: background 0.3s ease;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.dashboard-nav {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
}

.dashboard-nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.dashboard-content {
    padding: 2rem 0;
    background: #f5f7fa;
    min-height: calc(100vh - 200px);
    transition: background-color 0.3s ease;
}

/* Dark Mode for Admin */
[data-theme="dark"] .dashboard-content,
body.dark-mode .dashboard-content {
    background: #121212;
}

[data-theme="dark"] .section-card,
body.dark-mode .section-card,
[data-theme="dark"] .stat-card,
body.dark-mode .stat-card {
    background: #1C1B1F;
    border-color: #49454F;
    color: #E6E1E5;
}

[data-theme="dark"] .requests-table,
body.dark-mode .requests-table,
[data-theme="dark"] .users-table,
body.dark-mode .users-table,
[data-theme="dark"] .modules-table,
body.dark-mode .modules-table {
    background: #1C1B1F;
    border-color: #49454F;
}

[data-theme="dark"] .requests-table th,
body.dark-mode .requests-table th,
[data-theme="dark"] .users-table th,
body.dark-mode .users-table th {
    background: var(--admin-primary);
}

[data-theme="dark"] .requests-table tbody tr:hover,
body.dark-mode .requests-table tbody tr:hover,
[data-theme="dark"] .users-table tbody tr:hover,
body.dark-mode .users-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] input,
body.dark-mode input,
[data-theme="dark"] textarea,
body.dark-mode textarea,
[data-theme="dark"] select,
body.dark-mode select {
    background: #1C1B1F;
    color: #E6E1E5;
    border-color: #49454F;
}

[data-theme="dark"] .filters-section,
body.dark-mode .filters-section {
    background: #1C1B1F;
    border-color: #49454F;
}

/* Cards & Sections - Unified Style */
.section-card,
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.section-card:hover,
.stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.section-card h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
}

/* Stat Cards - Unified Style */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-right: 4px solid #3b82f6;
    margin-bottom: 0;
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    color: #1f2937;
}

.stat-info p {
    margin: 0.25rem 0 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Tables - Unified Style */
.requests-table,
.users-table,
.modules-table,
.articles-table,
.products-table,
.orders-table,
.leads-table,
.tickets-table,
.clients-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    table-layout: auto;
}

/* Table Container for wider tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table-container table {
    min-width: 100%;
}

.requests-table th,
.users-table th,
.modules-table th,
.articles-table th,
.products-table th,
.orders-table th,
.leads-table th,
.tickets-table th,
.clients-table th,
.requests-table td,
.users-table td,
.modules-table td,
.articles-table td,
.products-table td,
.orders-table td,
.leads-table td,
.tickets-table td,
.clients-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--md-outline);
    position: relative;
}

/* Resizable column handle */
.resizable {
    position: relative;
}

.resizable::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}

.resizable:hover::after {
    background: var(--admin-primary);
    opacity: 0.3;
}

.resizable.resizing::after {
    background: var(--admin-primary);
    opacity: 0.5;
}

.requests-table th,
.users-table th,
.modules-table th,
.articles-table th,
.products-table th,
.orders-table th,
.leads-table th,
.tickets-table th,
.clients-table th {
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-secondary) 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.requests-table tr:hover,
.users-table tr:hover,
.modules-table tr:hover,
.articles-table tr:hover,
.products-table tr:hover,
.orders-table tr:hover,
.leads-table tr:hover,
.tickets-table tr:hover,
.clients-table tr:hover {
    background-color: var(--md-surface-variant);
    transition: background-color 0.2s ease;
}

/* Buttons */
.btn,
.btn-primary,
.btn-outline,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 24px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: none;
    box-shadow: var(--admin-elevation-1);
}

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

.btn-primary:hover {
    background: var(--admin-primary-dark);
    box-shadow: var(--admin-elevation-2);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--admin-primary);
    color: var(--admin-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--admin-primary-dark);
    color: var(--admin-primary-dark);
}

.btn-success {
    background: var(--admin-success);
    color: var(--admin-on-primary);
}

.btn-success:hover {
    background: var(--admin-success-dark);
    box-shadow: var(--admin-elevation-2);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--admin-error);
    color: var(--admin-on-primary);
}

.btn-danger:hover {
    background: var(--admin-error-dark);
    box-shadow: var(--admin-elevation-2);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--admin-warning);
    color: var(--admin-on-primary);
}

.btn-warning:hover {
    background: var(--admin-warning-dark);
    box-shadow: var(--admin-elevation-2);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--admin-info);
    color: var(--admin-on-primary);
}

.btn-info:hover {
    background: var(--admin-info-dark);
    box-shadow: var(--admin-elevation-2);
    transform: translateY(-2px);
}

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

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status Badges */
.status-badge,
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--admin-elevation-1);
}

.badge-new,
.badge-active {
    background: rgba(67, 160, 71, 0.12);
    color: var(--admin-success-dark);
}

.badge-following,
.badge-pending {
    background: rgba(251, 140, 0, 0.12);
    color: var(--admin-warning-dark);
}

.badge-completed {
    background: rgba(67, 160, 71, 0.12);
    color: var(--admin-success-dark);
}

.badge-rejected,
.badge-inactive {
    background: rgba(229, 57, 53, 0.12);
    color: var(--admin-error-dark);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--admin-surface-variant);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--admin-surface);
    color: var(--admin-on-surface);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    background: var(--gradient-ocean, linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-secondary) 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

/* Filters Section */
.filters-section {
    background: var(--admin-surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--admin-elevation-1);
    margin-bottom: 2rem;
    border: 1px solid var(--admin-surface-variant);
}

/* Logout Button - Unified Style */
.logout-btn {
    float: left;
    background-color: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

/* Stats Grid - Unified Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Page Header - Unified Style */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1,
.page-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 700;
}

/* Content Cards - Unified Style */
.content-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Form Container - Unified Style */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

/* Filters Section - Unified Style */
.filters,
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

/* Alert Messages - Unified Style */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-nav a {
        margin-left: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

