/* ========================================
   POTOLO THEME - DESIGN SYSTEM
   ======================================== */

/* ========================================
   DESIGN TOKENS
   ======================================== */

:root {
    /* Color Palette */
    --potolo-primary: #00BCD4;
    --potolo-primary-dark: #0097A7;
    --potolo-primary-light: #4DD0E1;
    --potolo-secondary: #4A90E2;
    --potolo-accent: #00BCD4;
    
    /* Background Colors */
    --potolo-bg-main: #F0F8FF;
    --potolo-bg-sidebar: #F8F9FA;
    --potolo-bg-card: #FFFFFF;
    --potolo-bg-header: #FFFFFF;
    
    /* Text Colors */
    --potolo-text-primary: #333333;
    --potolo-text-secondary: #666666;
    --potolo-text-light: #999999;
    --potolo-text-white: #FFFFFF;
    
    /* Border Colors */
    --potolo-border: #E0E0E0;
    --potolo-border-light: #F0F0F0;
    
    /* Status Colors */
    --potolo-success: #4CAF50;
    --potolo-warning: #FF9800;
    --potolo-error: #F44336;
    --potolo-info: #2196F3;
    
    /* Spacing Scale */
    --potolo-space-xs: 4px;
    --potolo-space-sm: 8px;
    --potolo-space-md: 16px;
    --potolo-space-lg: 24px;
    --potolo-space-xl: 32px;
    --potolo-space-xxl: 40px;
    
    /* Typography */
    --potolo-font-family: 'Inter', 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --potolo-font-size-xs: 12px;
    --potolo-font-size-sm: 14px;
    --potolo-font-size-md: 16px;
    --potolo-font-size-lg: 18px;
    --potolo-font-size-xl: 20px;
    --potolo-font-size-xxl: 24px;
    
    /* Border Radius */
    --potolo-radius-sm: 4px;
    --potolo-radius-md: 8px;
    --potolo-radius-lg: 12px;
    --potolo-radius-xl: 16px;
    
    /* Shadows */
    --potolo-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --potolo-shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --potolo-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--potolo-font-family);
    background: var(--potolo-bg-main);
    color: var(--potolo-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--potolo-space-md);
    color: var(--potolo-text-primary);
}

h1 { font-size: var(--potolo-font-size-xxl); }
h2 { font-size: var(--potolo-font-size-xl); }
h3 { font-size: var(--potolo-font-size-lg); }
h4 { font-size: var(--potolo-font-size-md); }
h5 { font-size: var(--potolo-font-size-sm); }
h6 { font-size: var(--potolo-font-size-xs); }

p {
    margin-bottom: var(--potolo-space-md);
    color: var(--potolo-text-secondary);
}

.text-primary { color: var(--potolo-text-primary) !important; }
.text-secondary { color: var(--potolo-text-secondary) !important; }
.text-light { color: var(--potolo-text-light) !important; }
.text-white { color: var(--potolo-text-white) !important; }

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--potolo-space-lg);
}

/* Header */
.header {
    background: var(--potolo-bg-header);
    border-bottom: 1px solid var(--potolo-border-light);
    padding: var(--potolo-space-md) var(--potolo-space-lg);
    box-shadow: var(--potolo-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--potolo-space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--potolo-space-sm);
    font-size: var(--potolo-font-size-xl);
    font-weight: 700;
    color: var(--potolo-primary);
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--potolo-primary);
    border-radius: var(--potolo-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--potolo-text-white);
    font-size: 18px;
}

/* Sidebar */
.sidebar {
    background: var(--potolo-bg-sidebar);
    width: 280px;
    min-height: 100vh;
    padding: var(--potolo-space-lg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999;
    border-right: 1px solid var(--potolo-border-light);
}

.sidebar-header {
    margin-bottom: var(--potolo-space-xl);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--potolo-space-sm);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--potolo-space-md);
    padding: var(--potolo-space-md);
    color: var(--potolo-text-secondary);
    text-decoration: none;
    border-radius: var(--potolo-radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(0, 188, 212, 0.1);
    color: var(--potolo-primary);
}

.sidebar-nav a.active {
    background: var(--potolo-primary);
    color: var(--potolo-text-white);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

/* Sidebar Content */
.sidebar-content {
    margin-top: var(--potolo-space-xl);
    padding: 0 var(--potolo-space-md);
}

.sidebar-section {
    margin-bottom: var(--potolo-space-xl);
}

.sidebar-section h4 {
    font-size: var(--potolo-font-size-sm);
    font-weight: 600;
    color: var(--potolo-text-primary);
    margin-bottom: var(--potolo-space-md);
    display: flex;
    align-items: center;
    gap: var(--potolo-space-sm);
}

.sidebar-section h4 i {
    color: var(--potolo-primary);
}

.sidebar-item {
    background: var(--potolo-bg-card);
    border-radius: var(--potolo-radius-md);
    padding: var(--potolo-space-md);
    margin-bottom: var(--potolo-space-sm);
    box-shadow: var(--potolo-shadow-sm);
    border: 1px solid var(--potolo-border-light);
    display: flex;
    align-items: center;
    gap: var(--potolo-space-sm);
}

.sidebar-item-content {
    flex: 1;
}

.sidebar-item-content strong {
    display: block;
    color: var(--potolo-text-primary);
    font-size: var(--potolo-font-size-sm);
    margin-bottom: var(--potolo-space-xs);
}

.sidebar-item-content small {
    display: block;
    color: var(--potolo-text-secondary);
    font-size: var(--potolo-font-size-xs);
    margin-bottom: var(--potolo-space-xs);
}

.sidebar-item-content .amount {
    color: var(--potolo-success);
    font-weight: 600;
    font-size: var(--potolo-font-size-sm);
}

.sidebar-actions {
    display: flex;
    gap: var(--potolo-space-xs);
}

.sidebar-actions .btn {
    padding: var(--potolo-space-xs);
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.performance-summary {
    text-align: center;
    background: var(--potolo-bg-card);
    border-radius: var(--potolo-radius-md);
    padding: var(--potolo-space-lg);
    box-shadow: var(--potolo-shadow-sm);
    border: 1px solid var(--potolo-border-light);
}

.performance-rating {
    margin-bottom: var(--potolo-space-md);
}

.rating-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--potolo-primary);
    line-height: 1;
}

.rating-label {
    display: block;
    color: var(--potolo-text-secondary);
    font-size: var(--potolo-font-size-sm);
    margin-top: var(--potolo-space-xs);
}

.performance-details {
    color: var(--potolo-text-light);
    font-size: var(--potolo-font-size-xs);
}

.text-success {
    color: var(--potolo-success) !important;
}

.text-danger {
    color: var(--potolo-error) !important;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-open {
    margin-left: 0;
}

/* Header inside main content */
.main-content .header {
    background: var(--potolo-bg-header);
    border-bottom: 1px solid var(--potolo-border-light);
    padding: var(--potolo-space-md) var(--potolo-space-lg);
    box-shadow: var(--potolo-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-content .container {
    padding: var(--potolo-space-lg);
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

.card {
    background: var(--potolo-bg-card);
    border-radius: var(--potolo-radius-lg);
    box-shadow: var(--potolo-shadow-md);
    padding: var(--potolo-space-lg);
    margin-bottom: var(--potolo-space-lg);
    border: 1px solid var(--potolo-border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--potolo-space-lg);
    padding-bottom: var(--potolo-space-md);
    border-bottom: 1px solid var(--potolo-border-light);
}

.card-title {
    font-size: var(--potolo-font-size-lg);
    font-weight: 600;
    color: var(--potolo-text-primary);
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: var(--potolo-space-lg);
    padding-top: var(--potolo-space-md);
    border-top: 1px solid var(--potolo-border-light);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--potolo-space-sm);
    padding: var(--potolo-space-md) var(--potolo-space-lg);
    border: none;
    border-radius: var(--potolo-radius-md);
    font-family: var(--potolo-font-family);
    font-size: var(--potolo-font-size-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--potolo-primary);
    color: var(--potolo-text-white);
}

.btn-primary:hover {
    background: var(--potolo-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--potolo-shadow-md);
}

.btn-secondary {
    background: var(--potolo-bg-card);
    color: var(--potolo-text-primary);
    border: 1px solid var(--potolo-border);
}

.btn-secondary:hover {
    background: var(--potolo-bg-sidebar);
    border-color: var(--potolo-primary);
}

.btn-sm {
    padding: var(--potolo-space-sm) var(--potolo-space-md);
    font-size: var(--potolo-font-size-xs);
}

.btn-lg {
    padding: var(--potolo-space-lg) var(--potolo-space-xl);
    font-size: var(--potolo-font-size-md);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    margin-bottom: var(--potolo-space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--potolo-space-sm);
    font-weight: 500;
    color: var(--potolo-text-primary);
}

.form-control {
    width: 100%;
    padding: var(--potolo-space-md);
    border: 1px solid var(--potolo-border);
    border-radius: var(--potolo-radius-md);
    font-family: var(--potolo-font-family);
    font-size: var(--potolo-font-size-sm);
    background: var(--potolo-bg-card);
    color: var(--potolo-text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--potolo-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.form-control::placeholder {
    color: var(--potolo-text-light);
}

/* ========================================
   DATA TABLES
   ======================================== */

.data-table {
    width: 100%;
    background: var(--potolo-bg-card);
    border-radius: var(--potolo-radius-lg);
    overflow: hidden;
    box-shadow: var(--potolo-shadow-md);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--potolo-bg-sidebar);
    color: var(--potolo-text-primary);
    font-weight: 600;
    padding: var(--potolo-space-md);
    text-align: left;
    border-bottom: 1px solid var(--potolo-border);
}

.data-table td {
    padding: var(--potolo-space-md);
    border-bottom: 1px solid var(--potolo-border-light);
    color: var(--potolo-text-secondary);
}

.data-table tr:hover {
    background: rgba(0, 188, 212, 0.05);
}

/* ========================================
   STATISTICS CARDS
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--potolo-space-lg);
    margin-bottom: var(--potolo-space-xl);
}

.stat-card {
    background: var(--potolo-bg-card);
    border-radius: var(--potolo-radius-lg);
    padding: var(--potolo-space-lg);
    box-shadow: var(--potolo-shadow-md);
    border: 1px solid var(--potolo-border-light);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--potolo-shadow-lg);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--potolo-space-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--potolo-primary);
    border-radius: var(--potolo-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--potolo-text-white);
    font-size: 24px;
}

.stat-number {
    font-size: var(--potolo-font-size-xxl);
    font-weight: 700;
    color: var(--potolo-text-primary);
    margin-bottom: var(--potolo-space-sm);
}

.stat-label {
    color: var(--potolo-text-secondary);
    font-size: var(--potolo-font-size-sm);
    font-weight: 500;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
    background: var(--potolo-bg-header);
    border-bottom: 1px solid var(--potolo-border-light);
    padding: var(--potolo-space-md) 0;
    box-shadow: var(--potolo-shadow-sm);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--potolo-space-lg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--potolo-space-lg);
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: var(--potolo-space-sm);
    padding: var(--potolo-space-sm) var(--potolo-space-md);
    color: var(--potolo-text-secondary);
    text-decoration: none;
    border-radius: var(--potolo-radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(0, 188, 212, 0.1);
    color: var(--potolo-primary);
}

.nav-links a.active {
    background: var(--potolo-primary);
    color: var(--potolo-text-white);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--potolo-space-xs); }
.mb-2 { margin-bottom: var(--potolo-space-sm); }
.mb-3 { margin-bottom: var(--potolo-space-md); }
.mb-4 { margin-bottom: var(--potolo-space-lg); }
.mb-5 { margin-bottom: var(--potolo-space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--potolo-space-xs); }
.mt-2 { margin-top: var(--potolo-space-sm); }
.mt-3 { margin-top: var(--potolo-space-md); }
.mt-4 { margin-top: var(--potolo-space-lg); }
.mt-5 { margin-top: var(--potolo-space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--potolo-space-xs); }
.p-2 { padding: var(--potolo-space-sm); }
.p-3 { padding: var(--potolo-space-md); }
.p-4 { padding: var(--potolo-space-lg); }
.p-5 { padding: var(--potolo-space-xl); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.gap-1 { gap: var(--potolo-space-xs); }
.gap-2 { gap: var(--potolo-space-sm); }
.gap-3 { gap: var(--potolo-space-md); }
.gap-4 { gap: var(--potolo-space-lg); }
.gap-5 { gap: var(--potolo-space-xl); }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content-wrapper.sidebar-open {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-section {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --potolo-bg-main: #1a1a1a;
        --potolo-bg-sidebar: #2d2d2d;
        --potolo-bg-card: #333333;
        --potolo-bg-header: #2d2d2d;
        --potolo-text-primary: #ffffff;
        --potolo-text-secondary: #cccccc;
        --potolo-text-light: #999999;
        --potolo-border: #444444;
        --potolo-border-light: #333333;
    }
}
