/**
 * Mini CMS - Style panelu administracyjnego
 */

/* ============================================
   Zmienne globalne
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8cf8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-body: #f3f4f6;
    --bg-sidebar: #1f2937;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    
    --border: #e5e7eb;
    --border-dark: #374151;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    
    --sidebar-width: 260px;
    --topbar-height: 60px;
    
    --radius: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.2s ease;
}

/* ============================================
   Reset i podstawy
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.admin-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Layout admina
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
}



.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-section {
    padding: 12px 20px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-top: 10px;
    border-radius: 0;
}

/* Kolory sekcji */
.nav-section-cms {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-left: 3px solid #3b82f6;
}

.nav-section-gp {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-left: 3px solid #f59e0b;
}

.nav-section-users {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-left: 3px solid #10b981;
}

.nav-section-payments {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border-left: 3px solid #ec4899;
}

.nav-section-settings {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border-left: 3px solid #6b7280;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    opacity: 0.8;
    transition: var(--transition);
}

.sidebar-nav li a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
    color: var(--text-light);
}



.sidebar-nav li.active a {
    opacity: 1;
    background: var(--primary);
    color: var(--text-light);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-dark);
    position: sticky;
    bottom: 0;
    background: var(--bg-sidebar);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: var(--text-light);
    opacity: 0.8;
}

.sidebar-footer a:hover {
    opacity: 1;
}



/* ============================================
   Main content
   ============================================ */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

.admin-topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.role-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.admin-content {
    padding: 24px;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard h1 {
    font-size: 1.75rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.dashboard h1 i {
    color: var(--primary);
    margin-right: 10px;
}

/* Karty statystyk */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-info small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

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

.card-header h2 i {
    color: var(--primary);
    margin-right: 8px;
}

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

/* ============================================
   Tabele
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

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

.data-table td a {
    font-weight: 500;
}

/* ============================================
   Status badges
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-published,
.status-open,
.status-active,
.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-draft,
.status-upcoming,
.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-closed,
.status-completed,
.status-inactive {
    background: #e5e7eb;
    color: #374151;
}

.status-cancelled,
.status-refunded,
.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* ======================================

/* ============================================
   Kadrowanie obrazów - Modal
   ============================================ */
.cropper-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cropper-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.cropper-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.cropper-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.cropper-close:hover {
    color: var(--danger);
}

.cropper-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.cropper-canvas-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

.cropper-canvas-wrapper canvas {
    max-width: 100%;
    cursor: crosshair;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.cropper-controls {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.cropper-aspect-ratios,
.cropper-zoom {
    flex: 1;
    min-width: 200px;
}

.cropper-aspect-ratios label,
.cropper-zoom label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.aspect-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.aspect-buttons button {
    padding: 8px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.aspect-buttons button:hover {
    border-color: var(--primary);
}

.aspect-buttons button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cropper-zoom input[type="range"] {
    width: 100%;
    margin-top: 8px;
}

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