/* Modern CSS Design System for Online Printing & Ganging System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-hue: 224;
    --primary: hsl(var(--primary-hue), 85%, 55%);
    --primary-light: hsl(var(--primary-hue), 85%, 95%);
    --primary-dark: hsl(var(--primary-hue), 85%, 35%);
    
    --secondary-hue: 262;
    --secondary: hsl(var(--secondary-hue), 80%, 55%);
    --secondary-light: hsl(var(--secondary-hue), 80%, 95%);

    --success: hsl(142, 72%, 40%);
    --success-light: hsl(142, 72%, 95%);
    
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 95%);

    --danger: hsl(350, 80%, 50%);
    --danger-light: hsl(350, 80%, 95%);

    --bg-main: hsl(220, 25%, 97%);
    --bg-surface: hsl(0, 0%, 100%);
    --text-main: hsl(220, 30%, 15%);
    --text-muted: hsl(220, 12%, 50%);
    --border-color: hsl(220, 15%, 88%);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(60, 80, 120, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

/* Page Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, hsl(224, 60%, 15%) 0%, hsl(224, 60%, 8%) 100%);
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.sidebar-item.active a, .sidebar-item a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active a {
    background-color: var(--primary);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

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

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

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

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role-badge {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

/* Grid System & Cards */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

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

.icon-primary { background: var(--primary-light); color: var(--primary); }
.icon-secondary { background: var(--secondary-light); color: var(--secondary); }
.icon-success { background: var(--success-light); color: var(--success); }
.icon-warning { background: var(--warning-light); color: var(--warning); }
.icon-danger { background: var(--danger-light); color: var(--danger); }

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary);
}

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: hsl(142, 72%, 30%); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: hsl(350, 80%, 40%); }

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

/* Custom form elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Status Badges */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background-color: var(--warning-light); color: var(--warning); }
.badge-paid, .badge-approved, .badge-completed, .badge-delivered, .badge-success { background-color: var(--success-light); color: var(--success); }
.badge-failed, .badge-rejected, .badge-cancelled { background-color: var(--danger-light); color: var(--danger); }
.badge-processing, .badge-uploaded, .badge-batched, .badge-shipped { background-color: var(--primary-light); color: var(--primary); }

/* Table Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

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

.table th {
    background-color: hsl(220, 20%, 95%);
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
}

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

.table tr:hover td {
    background-color: hsl(220, 25%, 98%);
}

/* Order timeline */
.timeline {
    position: relative;
    padding-left: 32px;
    margin: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 4px var(--bg-main);
}

.timeline-item.completed::before {
    background-color: var(--success);
    border-color: var(--success);
}

.timeline-item.pending::before {
    background-color: var(--bg-surface);
    border-color: var(--text-muted);
}

.timeline-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.timeline-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

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

/* Pricing grid configuration */
.spec-pricing-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.spec-pricing-card:hover, .spec-pricing-card.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid hsl(142, 72%, 85%); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid hsl(38, 92%, 85%); }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid hsl(350, 80%, 85%); }

/* Ganging/Kanban Board */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.kanban-col {
    flex: 0 0 280px;
    background-color: hsl(220, 20%, 94%);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.kanban-col-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Dashboard Summary Cards */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.catalog-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.catalog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.catalog-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.catalog-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.catalog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-card-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

/* Authentication Layouts */
.auth-page {
    background: linear-gradient(135deg, hsl(224, 60%, 12%) 0%, hsl(224, 60%, 6%) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.auth-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

/* Responsive elements */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        padding: 24px 8px;
    }
    .sidebar-brand span, .sidebar-item span, .user-info-text {
        display: none;
    }
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 16px;
    }
    .sidebar-brand {
        border-bottom: none;
        margin-bottom: 12px;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

/* Sidebar Submenus */
.sidebar-item-group {
    display: flex;
    flex-direction: column;
}
.sidebar-item-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    outline: none;
    transition: var(--transition);
}
.sidebar-item-group summary::-webkit-details-marker {
    display: none;
}
.sidebar-item-group summary:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-item-group[open] summary {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}
.sidebar-submenu {
    list-style: none;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.sidebar-submenu-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}
.sidebar-submenu-item.active a, .sidebar-submenu-item a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-submenu-item.active a {
    background-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
