/*
 * CRM PREMIUM DESIGN SYSTEM
 * Modern, Glassmorphism, Sophisticated Color Palette
 */

:root {
    /* Color Palette - HSL Tailored */
    --primary-h: 221;
    --primary-s: 83%;
    --primary-l: 53%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 40%);
    
    --secondary: #64748b;
    --dark: #0f172a;
    --accent: #f43f5e;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-main: #f8fafc;
    --bg-white: rgba(255, 255, 255, 0.95);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 50px -12px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--dark);
    line-height: 1.6;
}

/* Sidebar Styling */
aside {
    background: linear-gradient(195deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
}

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

.logout-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
}

.logout-link:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.logout-link i {
    margin-right: 12px;
    color: #ef4444;
}

.sidebar-label {
    padding: 32px 24px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

.brand-wrapper {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.brand-logo:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    color: #fff;
    font-size: 1.2rem;
}

.brand-text {
    line-height: 1;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    display: block;
}

.brand-motto {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

aside nav a {
    text-decoration: none;
    color: #94a3b8;
    margin: 4px 12px;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-weight: 500;
}

aside nav a i {
    font-size: 1.1rem;
    margin-right: 12px;
    transition: var(--transition);
}

aside nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

aside nav a.active, aside nav a.bg-slate-700 {
    background: var(--primary) !important;
    color: #fff;
    box-shadow: 0 10px 20px -5px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.5);
}

/* Main Content & Header */
header {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 80px;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
    padding: 12px 16px 12px 42px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.header-search input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

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

.notification-bell {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #64748b;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: var(--transition);
}

.notification-bell:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--dark);
}

.profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 6px 16px 6px 6px;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #f1f5f9;
    min-width: 160px;
}

.avatar-default {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Premium Component Styles */
.card-premium {
	background: var(--bg-white);
	border-radius: var(--radius-lg);
	border: 1px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
	padding: 32px;
	transition: var(--transition);
	position: relative;
	overflow: hidden;
	max-width: 100%;
	backdrop-filter: blur(10px);
}

.card-premium:hover {
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
	transform: translateY(-4px);
	border-color: rgba(255, 255, 255, 0.6);
}

.gradient-blue { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: #fff; }
.gradient-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; }
.gradient-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: #fff; }

/* Tables */
.overflow-x-auto {
    border-radius: var(--radius-lg);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

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

th {
    background: #f1f5f9;
    padding: 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #64748b;
}

td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Buttons & Badges */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

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

.badge-premium {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.rounded-lg { border-radius: var(--radius-md); }
.p-8 { padding: 2rem; }
.min-h-screen { min-height: 100vh; }
.w-64 { width: 16rem; }
.flex-grow { flex-grow: 1; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #64748b; }
.text-blue-600 { color: var(--primary); }
.shadow { box-shadow: var(--shadow-soft); }
.bg-white { background: #fff; }

/* Scrollbar Modernization */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Modals & Overlays */
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-modal { z-index: 200; }
.bg-overlay { background-color: rgba(15, 23, 42, 0.5); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.hidden { display: none; }

.animate-in {
    animation-duration: 0.2s;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    animation-fill-mode: forwards;
}

.fade-in { animation-name: fadeIn; }
.zoom-in { animation-name: zoomIn; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Forms & UI Elements */
.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px var(--primary);
}

.max-h-40 { max-height: 10rem; }
.max-h-72 { max-height: 18rem; }
.overflow-y-auto { overflow-y: auto; }

.grid-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Spacing & Layout Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-10 { gap: 2.5rem; }

.w-full { width: 100%; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.overflow-hidden { overflow: hidden; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }

.break-all {
	word-break: break-all;
	overflow-wrap: break-word;
}
}

/* Padding & Borders */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-xs { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }

.border-b { border-bottom: 1px solid var(--border); }
.border-slate-100 { border-color: #f1f5f9; }

/* Typography */
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-2xs { font-size: 10px; }
.text-3xs { font-size: 9px; }

.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.leading-none { line-height: 1; }

#userModal form, #groupModal form {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

#userModal form::-webkit-scrollbar, #groupModal form::-webkit-scrollbar {
    width: 4px;
}
#userModal form::-webkit-scrollbar-thumb, #groupModal form::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* Close Button */
.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #94a3b8;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Inline Add Button */
.btn-add-inline {
    background: #eff6ff;
    color: #3b82f6;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s;
    border: 1px solid #dbeafe;
    cursor: pointer;
}

.btn-add-inline:hover {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Workflow Status Badges */
.badge-premium {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-pending { background: #f1f5f9; color: #64748b; }
.status-design { background: #dbeafe; color: #2563eb; }
.status-layout_ready { background: #fef3c7; color: #d97706; }
.status-awaiting_approval { background: #ffedd5; color: #ea580c; }
.status-approved { background: #d1fae5; color: #059669; }
.status-production { background: #e0e7ff; color: #4f46e5; }
.status-completed { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #dc2626; }

/* Timeline Dot Enhancement */
.timeline-dot {
    background: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Global Premium Form Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: var(--radius-md);
	font-family: inherit;
	font-size: 14px;
	color: var(--dark);
	transition: var(--transition);
	outline: none;
	appearance: none;
}

select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 40px;
}

input:focus,
select:focus,
textarea:focus {
	background: #fff;
	border-color: var(--primary);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 8px;
	margin-top: 16px;
}

.form-group-premium {
	margin-bottom: 24px;
}

/* Custom Scrollbar for Pre/Code */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: #e2e8f0;
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
	background: #cbd5e1;
}
