/* Sole Portofino Admin Panel Styles */

:root {
    --primary: #5C6AC4;
    --primary-dark: #4A5AA8;
    --secondary: #006FBB;
    --success: #00A871;
    --warning: #F7C137;
    --danger: #D72C0D;
    --info: #007ACE;
    
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-dark: #FFFFFF;
    
    --text-primary: #202223;
    --text-secondary: #637381;
    --text-muted: #919EAB;
    
    --border-color: #E3E5E8;
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    
    --sidebar-width: 240px;
    --header-height: 60px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

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

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

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

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

.login-header p {
    color: var(--text-secondary);
    margin-top: 5px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.login-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-loading {
    display: inline-flex;
    align-items: center;
}

.spinner {
    animation: rotate 2s linear infinite;
}

.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    background: #FEE;
    color: var(--danger);
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

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

/* Admin Layout */
body:not(.login-page) {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--border-color);
}

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

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text-primary);
}

.admin-badge {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(92, 106, 196, 0.1);
    font-weight: 500;
}

.nav-item.active::before {
    display: none;
}

.nav-item .icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

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

.logout-button {
    width: calc(100% - 32px);
    margin: 0 16px;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: var(--bg-primary);
    color: var(--danger);
    border-color: var(--danger);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.main-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.refresh-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
}

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

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

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 0 30px 30px;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

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

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.period-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Tables */
.table-section {
    margin: 0 30px 30px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 16px 24px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: #FFF3CD;
    color: #856404;
}

.status-badge.processing {
    background: #D1ECF1;
    color: #0C5460;
}

.status-badge.completed {
    background: #D4EDDA;
    color: #155724;
}

.status-badge.cancelled {
    background: #F8D7DA;
    color: #721C24;
}

/* Activity Feed */
.activity-section {
    margin: 0 30px 30px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.activity-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.activity-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
}

/* Additional Clean Styles */
.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Remove icon styling since we're using simple dots */
.nav-item .icon {
    font-size: 8px;
    opacity: 0.4;
}

.nav-item.active .icon {
    opacity: 1;
    color: var(--primary);
}

/* Analytics specific */
.analytics-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 24px;
}

.kpi-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

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

.kpi-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.kpi-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0;
}

.kpi-comparison {
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-change {
    font-size: 13px;
    font-weight: 500;
}

.kpi-change.positive {
    color: var(--success);
}

.kpi-change.negative {
    color: var(--danger);
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 0 24px 24px;
}

.chart-card.large {
    grid-column: span 1;
}

.chart-card.full-width {
    margin: 0 24px 24px;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-btn.active,
.chart-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Products specific */
.product-stats {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-mini .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-mini .stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.filters-section {
    display: flex;
    gap: 16px;
    padding: 0 24px 24px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0 24px 24px;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: var(--primary);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 16px;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.product-sku {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.product-stock {
    font-size: 13px;
    color: var(--text-secondary);
}

.product-stock.out-of-stock {
    color: var(--danger);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-sm.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

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

.pagination-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Responsive */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-header {
        padding: 15px 20px;
    }
    
    .stats-grid,
    .charts-section,
    .table-section,
    .activity-section {
        padding: 20px;
        margin: 0 20px 20px;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}