/*
Theme Name: DigiScaler CRM
Theme URI: https://digiscaler.com/
Author: DigiScaler
Description: A purpose-built companion theme for the DigiScaler CRM plugin. It deliberately ships almost no opinionated styling, so the CRM looks exactly the same whichever site it runs on. Pages containing the [digiscaler_crm] shortcode render full-screen with no header, footer or sidebar; ordinary pages get a plain, readable layout.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: digiscaler-theme
Tags: full-width-template, one-column, custom-logo
*/

/* =========================================================
   WHY THIS FILE IS SO SHORT

   The usual reason a CRM looks different from one site to the
   next is the theme: every theme restyles buttons, inputs,
   tables and links, and those styles leak into the plugin's
   markup. This theme fixes that by NOT having opinions —
   it lays out the page and then gets out of the way, and the
   isolation layer at the bottom undoes anything that might
   still reach inside the app.
   ========================================================= */

:root {
	--dst-bg: #F4F5FA;
	--dst-card: #FFFFFF;
	--dst-text: #1F2333;
	--dst-muted: #6B7280;
	--dst-border: #E9EAF2;
	--dst-primary: #4F46E5;
	--dst-radius: 12px;
	--dst-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--dst-font);
	font-size: 15px;
	line-height: 1.6;
	color: var(--dst-text);
	background: var(--dst-bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

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

/* ---------------------------------------------------------
   CRM pages: full screen, no chrome
   --------------------------------------------------------- */
body.dst-crm-page {
	background: var(--dst-bg);
	/* The app manages its own scrolling and full-bleed width. */
	overflow-x: hidden;
}

.dst-crm-wrap {
	min-height: 100vh;
	padding: 20px;
}

@media (max-width: 782px) {
	.dst-crm-wrap { padding: 10px; }
}

/* ---------------------------------------------------------
   Ordinary pages (login landing, privacy policy, anything else)
   --------------------------------------------------------- */
.dst-site-header {
	background: var(--dst-card);
	border-bottom: 1px solid var(--dst-border);
}

.dst-bar {
	max-width: 1100px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.dst-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 18px;
	color: var(--dst-text);
	text-decoration: none;
}

.dst-brand img { max-height: 36px; width: auto; }

.dst-nav {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dst-nav a {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--dst-muted);
	font-size: 14px;
}

.dst-nav a:hover,
.dst-nav .current-menu-item > a {
	background: var(--dst-bg);
	color: var(--dst-text);
}

.dst-main {
	max-width: 1100px;
	margin: 0 auto;
	padding: 28px 20px 48px;
}

.dst-card {
	background: var(--dst-card);
	border: 1px solid var(--dst-border);
	border-radius: var(--dst-radius);
	padding: 28px;
}

.dst-card > *:first-child { margin-top: 0; }
.dst-card > *:last-child { margin-bottom: 0; }

.dst-title { margin: 0 0 16px; font-size: 26px; line-height: 1.25; }

.dst-entry h1, .dst-entry h2, .dst-entry h3 { line-height: 1.3; }
.dst-entry table { width: 100%; border-collapse: collapse; }
.dst-entry th, .dst-entry td { border: 1px solid var(--dst-border); padding: 8px 10px; text-align: left; }
.dst-entry blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--dst-border); color: var(--dst-muted); }
.dst-entry code { background: var(--dst-bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.dst-cta {
	display: inline-block;
	margin-top: 8px;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--dst-primary);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
}

.dst-site-footer {
	border-top: 1px solid var(--dst-border);
	background: var(--dst-card);
}

.dst-site-footer .dst-bar {
	justify-content: center;
	color: var(--dst-muted);
	font-size: 13px;
}

/* Skip link — keyboard users land on the app, not the menu. */
.dst-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--dst-card);
	padding: 10px 16px;
	z-index: 100000;
}
.dst-skip:focus { left: 10px; top: 10px; }

/* =========================================================
   CRM ISOLATION LAYER

   Everything below exists so the plugin's own stylesheet is
   the only thing deciding how the app looks. These are
   neutralisers, not styles: they reset what a theme would
   normally impose, and leave the actual appearance to the
   plugin. Do NOT add colours or spacing here — that is the
   plugin's job, and duplicating it here is how the two drift
   apart.
   ========================================================= */
#digiscaler-crm-shell,
#digiscaler-crm-app {
	max-width: none;
	margin: 0;
	float: none;
	width: auto;
}

#digiscaler-crm-app * {
	box-sizing: border-box;
}

/* Themes commonly set a font stack, letter-spacing or text-transform on
   headings and buttons. Inside the app, inherit instead. */
#digiscaler-crm-app h1,
#digiscaler-crm-app h2,
#digiscaler-crm-app h3,
#digiscaler-crm-app h4,
#digiscaler-crm-app button,
#digiscaler-crm-app input,
#digiscaler-crm-app select,
#digiscaler-crm-app textarea {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* A theme's global `a { text-decoration: underline }` turns every table
   cell link and nav item into a mess. */
#digiscaler-crm-app a { text-decoration: none; box-shadow: none; }
#digiscaler-crm-app a:focus { outline: none; }

/* Form controls are the worst offenders: themes give them their own
   borders, radii, heights and background images. */
#digiscaler-crm-app input[type="text"],
#digiscaler-crm-app input[type="email"],
#digiscaler-crm-app input[type="url"],
#digiscaler-crm-app input[type="tel"],
#digiscaler-crm-app input[type="number"],
#digiscaler-crm-app input[type="search"],
#digiscaler-crm-app input[type="password"],
#digiscaler-crm-app input[type="date"],
#digiscaler-crm-app input[type="datetime-local"],
#digiscaler-crm-app select,
#digiscaler-crm-app textarea {
	max-width: 100%;
	min-height: 0;
	line-height: normal;
	background-image: none;
	box-shadow: none;
	text-transform: none;
}

#digiscaler-crm-app button {
	background-image: none;
	box-shadow: none;
	text-shadow: none;
}

/* Some themes zebra-stripe or border every table on the site. */
#digiscaler-crm-app table {
	border-collapse: collapse;
	margin: 0;
	width: 100%;
}
#digiscaler-crm-app th,
#digiscaler-crm-app td {
	background: none;
}

/* Block themes wrap content in constrained layouts that squeeze the app. */
.dst-crm-page .is-layout-constrained > *,
.dst-crm-page .entry-content > * {
	max-width: none;
}
