/* ==========================================================================
   WorkBangers CRM — Глобальные стили
   Шрифт: Rubik
   Тема: С поддержкой Светлой/Темной (Dark/Light)
   ========================================================================== */

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

:root {
	/* Базовые цвета, не зависящие от темы */
	--primary-color: #10b981; /* Emerald-500 (как в Dasher) */
	--primary-hover: #059669;
	--primary-light: rgba(16, 185, 129, 0.1);

	--success-color: #10b981;
	--warning-color: #f59e0b;
	--danger-color: #ef4444;
	--info-color: #3b82f6;

	/* Радиусы и тени */
	--radius-sm: 1px;
	--radius-md: 3px;
	--radius-lg: 5px;
	
	--font-family: 'Rubik', sans-serif;
	
	--sidebar-width: 260px;
	--sidebar-collapsed-width: 80px;
	--topbar-height: 70px;
}

/* -------------------------------------------------------
   1. Светлая тема (Light Mode) - По умолчанию
------------------------------------------------------- */
:root, [data-theme="light"] {
	--bg-body: #f1f5f9;
	--bg-card: #ffffff;
	--bg-sidebar: #ffffff;
	--bg-topbar: #ffffff;
	--bg-hover: #f8fafc;

	--text-main: #1e293b;
	--text-muted: #64748b;
	--text-inverse: #ffffff;

	--border-color: #e2e8f0;
	
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-card: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
	
	--color-scheme: light;
}

/* -------------------------------------------------------
   2. Темная тема (Dark Mode)
------------------------------------------------------- */
[data-theme="dark"] {
	--bg-body: #0f172a;       /* Slate-900 */
	--bg-card: #1e293b;       /* Slate-800 */
	--bg-sidebar: #1e293b;
	--bg-topbar: #1e293b;
	--bg-hover: #334155;      /* Slate-700 */

	--text-main: #f8fafc;     /* Slate-50 */
	--text-muted: #94a3b8;    /* Slate-400 */
	--text-inverse: #0f172a;

	--border-color: #334155;
	
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
	--shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
	
	--color-scheme: dark;
}

/* Поддержка системной темы по умолчанию, если JS еще не отработал */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg-body: #0f172a;
		--bg-card: #1e293b;
		--bg-sidebar: #1e293b;
		--bg-topbar: #1e293b;
		--bg-hover: #334155;
		--text-main: #f8fafc;
		--text-muted: #94a3b8;
		--text-inverse: #0f172a;
		--border-color: #334155;
		--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
		--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
		--shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
		--color-scheme: dark;
	}
}

/* -------------------------------------------------------
   3. Сброс (CSS Reset)
------------------------------------------------------- */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--font-family);
	background-color: var(--bg-body);
	color: var(--text-main);
	font-size: 0.9375rem; /* 15px */
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	color-scheme: var(--color-scheme);
	transition: background-color 0.3s ease, color 0.3s ease;
	overflow-x: hidden;
}

a {
	color: var(--primary-color);
	text-decoration: none;
	transition: all 0.3s ease;
}

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

h1, h2, h3, h4, h5, h6 {
	color: var(--text-main);
	font-weight: 600;
	margin-bottom: 0.5rem;
}

p {
	margin-bottom: 1rem;
}

/* -------------------------------------------------------
   4. Утилиты (Utility Classes)
------------------------------------------------------- */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; color: white; }
.bg-success { background-color: var(--success-color) !important; color: white; }
.bg-warning { background-color: var(--warning-color) !important; color: #000; }
.bg-danger { background-color: var(--danger-color) !important; color: white; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.pt-1 { padding-top: 0.5rem !important; }
.pb-1 { padding-bottom: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.flex-column { flex-direction: column !important; }
.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
