/* ============================================================================
   GRAYCLOTHES SHOP - GLOSSY BLUE DESIGN
   Based on Purple Legion but with blue colors
   ============================================================================ */

:root {
    --primary-blue: #3b82f6;
    --primary-blue-light: #60a5fa;
    --primary-blue-dark: #2563eb;
    --accent-cyan: #06b6d4;
    --bg-dark: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --border-color: rgba(59, 130, 246, 0.3);
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */
.sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    width: 280px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    box-shadow: 8px 0 25px rgba(0,0,0,0.5);
    overflow-y: auto;
    z-index: 8000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo h2 {
    color: var(--primary-blue-light);
    margin-bottom: 4px;
    font-size: 1.4rem;
    font-weight: 700;
}

.sidebar-header .logo p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sidebar-nav {
    padding: 20px 12px 100px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    padding: 0 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    margin: 4px 0;
    gap: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateX(6px);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.4);
    border-left: 3px solid var(--primary-blue-light);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-icon {
    font-size: 1.3rem;
    min-width: 26px;
}

.nav-text {
    flex: 1;
    font-weight: 500;
}

.nav-badge {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(147, 197, 253, 0.3);
}

.sidebar-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 280px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 8001;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.95rem;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-btn {
    font-size: 1.5rem;
    padding: 6px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* ============================================================================
   HEADER
   ============================================================================ */
.top-header {
    width: calc(100% - 280px);
    height: 70px;
    padding: 14px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 280px;
    z-index: 9000;
    transition: left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .top-header {
    left: 0;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.toggle-btn {
    background: rgba(59, 130, 246, 0.35);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-btn:hover {
    background: rgba(59, 130, 246, 0.55);
    transform: scale(1.05);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb a {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: #bfdbfe;
}

.breadcrumb span {
    color: #64748b;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-link {
    text-decoration: none;
    color: #93c5fd;
    font-size: 0.9rem;
    transition: color 0.2s;
    font-weight: 500;
}

.header-link:hover {
    color: #bfdbfe;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: 0.2s;
}

.user-btn:hover {
    background: rgba(59, 130, 246, 0.25);
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
}

.avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    right: 0;
    margin-top: 12px;
    padding: 12px;
    background: rgba(15,23,42,0.98);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 14px;
    display: none;
    flex-direction: column;
    min-width: 200px;
    z-index: 99999;
    box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}

.user-dropdown.show {
    display: flex;
}

.user-dropdown a {
    padding: 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-dropdown a:hover {
    background: rgba(59, 130, 246, 0.3);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 8px 0;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

.main-content.expanded {
    margin-left: 0;
}

.page-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1rem;
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

.card-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 700;
}

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

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue-light);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-secondary {
    background: rgba(100, 116, 139, 0.4);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ============================================================================
   TABLES
   ============================================================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

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

table thead {
    background: rgba(59, 130, 246, 0.2);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-primary);
}

table tbody tr {
    transition: background 0.2s;
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* ============================================================================
   BADGES
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(110, 231, 183, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(252, 165, 165, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
    border: 1px solid rgba(252, 211, 77, 0.3);
}

.badge-primary {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.3);
}

/* ============================================================================
   ALERTS
   ============================================================================ */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border-left: 4px solid #10b981;
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border-left: 4px solid #ef4444;
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border-left: 4px solid #f59e0b;
    color: #fcd34d;
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3b82f6;
    color: #93c5fd;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1.5rem; }
.d-flex { display: flex; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* ============================================================================
   SCROLLBAR
   ============================================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .top-header {
        left: 0;
        width: 100%;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
