/* Design tokens: the Royal brand colours, module accents, spacing, radius, shadow and motion. */

:root {
    color-scheme: light;
    /* EstatePro brand tokens: Royal (the only colour theme since 28 Nov 2026). Change colours here only. */
    --ep-primary: #2c52c8;
    --ep-primary-strong: #213f9e;
    --ep-primary-soft: #e8eefc;
    --ep-primary-border: #c0cff2;
    --ep-accent: #f2b84b;
    --ep-accent-strong: #a8700c;
    --ep-bg: #f5f7fc;
    --ep-surface: #ffffff;
    --ep-surface-subtle: #eef2fa;
    --ep-border: #dbe1ee;
    --ep-input-border: #c2cbe0;
    --ep-text: #121a2c;
    --ep-heading: #0f1d4a;
    --ep-muted: #475069;
    --ep-success: #15803d;
    --ep-warning: #a15c07;
    --ep-danger: #c0262d;
    --ep-info: #2c52c8;
    --ep-font-arabic: 'IBM Plex Sans Arabic';
    --ep-font-latin: 'Inter';
    --ep-font: var(--ep-font-latin), var(--ep-font-arabic), system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;

    /* Legacy variable names used across the stylesheets, mapped to the brand tokens. */
    --page-background: var(--ep-bg);
    --surface-subtle: var(--ep-surface-subtle);
    --white: #ffffff;
    --text: var(--ep-text);
    --text-heading: var(--ep-heading);
    --text-muted: var(--ep-muted);
    --link-blue: var(--ep-info);
    --blue-header: var(--ep-primary-strong);
    --blue-header-end: var(--ep-primary-strong);
    --blue-button: var(--ep-primary);
    --blue-primary: var(--ep-primary);
    --blue-focus: #3a60d6;
    --adalo-gold: var(--ep-accent);
    --adalo-gold-dark: var(--ep-accent-strong);
    --selection-background: var(--ep-primary-soft);
    --surface-border: var(--ep-border);
    --surface-hover: var(--ep-surface-subtle);
    --input-border: var(--ep-input-border);
    --table-header: var(--ep-surface-subtle);
    --table-border: var(--ep-border);
    --shadow-card: 0 1px 2px rgba(10, 61, 57, 0.06), 0 6px 16px -6px rgba(10, 61, 57, 0.10);

    /* Module accents: used only as a thin accent line, icon tint and soft background. */
    --mod-accounts: #2c52c8;
    --mod-accounts-tint: #e8eefc;
    --mod-accounts-border: #c0cff2;

    --mod-properties: #2f6fb0;
    --mod-properties-tint: #e8f0f9;
    --mod-properties-border: #bcd2ea;

    --mod-contracts: #6a4fb3;
    --mod-contracts-tint: #f0ecf9;
    --mod-contracts-border: #d2c7ec;

    --mod-invoices: #1e8e5a;
    --mod-invoices-tint: #e6f4ed;
    --mod-invoices-border: #b8dfca;

    --mod-cashcollections: #c8963e;
    --mod-cashcollections-tint: #faf3e6;
    --mod-cashcollections-border: #ead3a6;

    --mod-expenses: #c0392b;
    --mod-expenses-tint: #fbecea;
    --mod-expenses-border: #efc3be;

    --mod-tickets: #0e7490;
    --mod-tickets-tint: #e3f4f8;
    --mod-tickets-border: #b4dde8;

    --mod-accent: var(--ep-primary);
    --mod-tint: var(--ep-primary-soft);
    --mod-border: var(--ep-primary-border);
}


.mod-accounts { --mod-accent: var(--mod-accounts); --mod-tint: var(--mod-accounts-tint); --mod-border: var(--mod-accounts-border); }

.mod-properties { --mod-accent: var(--mod-properties); --mod-tint: var(--mod-properties-tint); --mod-border: var(--mod-properties-border); }

.mod-contracts { --mod-accent: var(--mod-contracts); --mod-tint: var(--mod-contracts-tint); --mod-border: var(--mod-contracts-border); }

.mod-invoices { --mod-accent: var(--mod-invoices); --mod-tint: var(--mod-invoices-tint); --mod-border: var(--mod-invoices-border); }

.mod-cashcollections { --mod-accent: var(--mod-cashcollections); --mod-tint: var(--mod-cashcollections-tint); --mod-border: var(--mod-cashcollections-border); }

.mod-tickets { --mod-accent: var(--mod-tickets); --mod-tint: var(--mod-tickets-tint); --mod-border: var(--mod-tickets-border); }

.mod-expenses { --mod-accent: var(--mod-expenses); --mod-tint: var(--mod-expenses-tint); --mod-border: var(--mod-expenses-border); }

/* ---------- "Royal card" side menu (see WEB-INF/fragments/navigation.xhtml) ---------- */
:root { --sidebar-width: 268px; --sidebar-rail: 84px; --sidebar-gap: 14px; --drawer-hidden: -110%; --nudge: 4px; --topbar-height: 0px; }

html[dir=rtl] { --drawer-hidden: 110%; --nudge: -4px; }

html.nav-collapsed { --sidebar-width: var(--sidebar-rail); }

/* Collapsed icon rail (wide screens only): equal 48px tiles with 24px icons; labels appear in a hover bubble. */
:root { --rail-tile: 46px; --rail-icon: 24px; }


@media (min-width: 1025px) {
    html.nav-collapsed { --sidebar-rail: 88px; }
}

/* ---------- Design scale shared by every component ---------- */
:root {
    /* Spacing (4px grid) */
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    /* Corners */
    --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 18px; --radius-pill: 999px;
    /* Elevation */
    --shadow-xs: 0 1px 2px rgb(16 24 40 / 5%);
    --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%), 0 1px 3px rgb(16 24 40 / 6%);
    --shadow-md: 0 4px 8px -2px rgb(16 24 40 / 8%), 0 2px 4px -2px rgb(16 24 40 / 5%);
    --shadow-lg: 0 16px 32px -12px rgb(16 24 40 / 22%), 0 4px 8px -4px rgb(16 24 40 / 6%);
    --shadow-xl: 0 32px 64px -16px rgb(16 24 40 / 32%);
    /* Type scale */
    --text-xs: 12px; --text-sm: 13.5px; --text-md: 15px; --text-lg: 17px; --text-xl: 20px; --text-2xl: 24px;
    /* Controls */
    --control-height: 42px; --control-height-sm: 34px; --control-height-lg: 50px;
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--ep-primary) 28%, transparent);
    /* Motion */
    --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.2, 1.3, .4, 1);
    --duration-fast: 120ms; --duration: 200ms; --duration-slow: 320ms;
    /* Status colours (text on soft background passes WCAG AA) */
    --status-success: #15803d; --status-success-soft: #e8f7ee; --status-success-border: #b9e4c8;
    --status-warning: #a15c07; --status-warning-soft: #fdf4e1; --status-warning-border: #f3d9a6;
    --status-danger: #c0262d; --status-danger-soft: #fdecec; --status-danger-border: #f5c2c4;
    --status-info: var(--ep-primary); --status-info-soft: var(--ep-primary-soft); --status-info-border: var(--ep-primary-border);
    --status-neutral: #3b4456; --status-neutral-soft: #f1f3f7; --status-neutral-border: #dde2ea;
    /* Layout */
    --content-max: 1240px;
    /* Icons used as CSS masks */
    --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E");
    --icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.5 20h19z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.5'/%3E%3C/svg%3E");
    --icon-empty: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 13.5 6 5.5h12l2.5 8v5h-17z'/%3E%3Cpath d='M3.5 13.5h5l1 2h5l1-2h5'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
    :root { --duration-fast: 0ms; --duration: 0ms; --duration-slow: 0ms; }
}
