:root {
    --app-primary: #5b21e8;
    --app-primary-2: #2563eb;
    --app-dark: #0f172a;
    --app-muted: #64748b;
    --app-bg: #f8fafc;
    --app-border: #e5e7eb;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--app-bg);
    color: var(--app-dark);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-topbar {
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 1040;
    background: linear-gradient(135deg, #4f46e5, #6d28d9, #2563eb);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

.app-topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.app-brand:hover { color: #fff; }

.app-menu-toggle {
    display: none;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.12);
    color: #fff;
    border-radius: 12px;
    width: 42px;
    height: 38px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.app-nav a {
    color: rgba(255,255,255,.92);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.app-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.14);
}

.app-userbox {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.app-user-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.app-user-name small {
    opacity: .85;
    font-weight: 700;
}

.app-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(251,191,36,.18);
    border: 1px solid rgba(251,191,36,.35);
    color: #fff7ed;
    font-size: 12px;
    font-weight: 900;
}

.app-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    text-decoration: none;
}

.app-logout:hover { background: rgba(255,255,255,.22); color: #fff; }

.main-content {
    padding: 24px;
}

.crm-v1 {
    max-width: 1500px;
    margin: 0 auto;
}

@media (max-width: 992px) {
    .app-topbar-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .app-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .app-nav { width: 100%; flex-direction: column; align-items: stretch; order: 5; }
    .app-nav a { border-radius: 14px; }
    .app-userbox { margin-left: auto; }
    .main-content { padding: 16px; }
}

/* ===== V2 Master Layout - Home/Admin navbar ===== */
.app-admin-navbar {
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-public-navbar {
    background: linear-gradient(135deg, #0f172a, #1d4ed8, #0f766e);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.logo-home-pozitif { max-height: 42px; width: auto; }
.main-content { min-height: calc(100vh - 170px); padding: 24px; background: #f8fafc; }
.app-footer { background: #0f172a; }
.navbar .dropdown-menu { border: 0; border-radius: 16px; box-shadow: 0 18px 45px rgba(15, 23, 42, .16); padding: 10px; }
.navbar .dropdown-item { border-radius: 12px; font-weight: 600; font-size: 14px; }
.navbar .dropdown-item:hover { background: #eef2ff; color: #3730a3; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, .9); font-weight: 700; font-size: 14px; }
.navbar-dark .navbar-nav .nav-link:hover { color: #fff; }
.admin-user-dropdown .dropdown-menu { min-width: 220px; }

/* ===== V2 CRM Takvim time/status + charts ===== */
.crm-time-status {
    margin-top: 14px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    border: 1px solid #dbeafe;
    box-shadow: 0 16px 45px rgba(15, 23, 42, .08);
    display: flex;
    align-items: center;
    gap: 16px;
}
.crm-time-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.crm-time-status strong { display: block; color: #0f172a; font-size: 17px; font-weight: 900; }
.crm-time-status span { display: block; color: #64748b; font-size: 14px; }
.crm-live-clock { margin-left: auto; font-size: 24px; font-weight: 900; color: #1d4ed8; background: #fff; padding: 10px 16px; border-radius: 18px; border: 1px solid #dbeafe; }
.crm-chart-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.crm-chart-card { padding: 18px; border-radius: 24px; }
.crm-chart-card h5 { font-size: 15px; font-weight: 900; color: #0f172a; margin-bottom: 12px; }
.crm-chart-card canvas { max-height: 230px; }

@media (max-width: 1200px) { .crm-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991px) { .main-content { padding: 16px; } .navbar-nav { gap: 4px; } }
@media (max-width: 576px) { .crm-chart-grid { grid-template-columns: 1fr; } .crm-time-status { flex-direction: column; align-items: flex-start; } .crm-live-clock { margin-left: 0; } }
