@import './monthly-workforce.css';
@import './employee-management.css';
@import 'leaflet/dist/leaflet.css';
@import './global-sidebar.css';
@import './worker-dashboard.css';
@import '@fontsource-variable/geist';
@import '@fontsource-variable/geist-mono';
@import 'tailwindcss';
@import './dashboard-premium.css';
@import './worksites-premium.css';
@import './attendance-feedback.css';
@import './admin-reference.css';
@import './workspace-layout.css';
@import './black-titanium.css';
@import './login-titanium.css';
@import './reports-workspace.css';
@import './reports-premium.css';
@import './daily-reports-center.css';
@import './material-orders-center.css';
@import './leave-management-center.css';

@source '../views';
@source '../../app/Livewire';
@source not '../../.tools';
@source not '../../vendor';
@source not '../../storage';

/*
 * RAMA AG — Black Titanium LIGHT EDITION (official default): light workspace (#F0F1F3), white surfaces, near-black
 * sidebar (#111214), black primary actions. BLACK TITANIUM DOES NOT MEAN FULL DARK MODE.
 * Red is reserved for genuine errors only.
 */
@theme {
    --font-sans: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

    --color-workspace: #f0f1f3;
    --color-background: #f0f1f3;
    --color-foreground: #111214;
    --color-card: #ffffff;
    --color-primary: #111214;
    --color-primary-ink: #111214;
    --color-brand: #111214;
    --color-primary-foreground: #ffffff;
    --color-secondary: #f0f1f3;
    --color-muted: #f0f1f3;
    --color-muted-foreground: #686d76; /* owner token #717680, darkened 0.6 % for WCAG AA 4.5:1 on the #F0F1F3 workspace */
    --color-accent: #e9eaed;
    --color-accent-foreground: #111214;
    --color-info-soft: #eef0f3;
    --color-success: #0f7552;
    --color-success-soft: #e3f6ee;
    --color-warning: #9a5107;
    --color-warning-soft: #fdf1dc;
    --color-destructive: #c4321c;
    --color-border: #e2e4e8;
    --color-input: #e2e4e8;
    --color-ring: #a8adb5;
    --color-sidebar: #111214;
    --color-sidebar-foreground: #a8adb5;
    --color-sidebar-ring: #a8adb5;

    --font-mono: 'Geist Mono Variable', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Same radius scale as the original (--radius: 0.75rem; sm .6, md .8, lg 1, xl 1.4, 2xl 1.8, 3xl 2.2, 4xl 2.6 × radius). */
    --radius-sm: 0.45rem;
    --radius-md: 0.6rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1.05rem;
    --radius-2xl: 1.35rem;
    --radius-3xl: 1.65rem;
    --radius-4xl: 1.95rem;

    --shadow-soft: 0 1px 2px rgb(17 18 20 / 0.04);
    --shadow-lift: 0 2px 4px rgb(17 18 20 / 0.05), 0 10px 24px rgb(17 18 20 / 0.07);
}

@layer base {
    * {
        border-color: var(--color-border);
        outline-color: color-mix(in oklab, var(--color-ring) 50%, transparent);
    }
    /* A scroll container must also be the containing block of absolutely positioned children, otherwise they escape the clip and widen the page on phones. */
    .overflow-x-auto,
    .overflow-auto {
        position: relative;
    }
    html {
        font-family: var(--font-sans);
        -webkit-text-size-adjust: 100%;
    }
    body {
        background: var(--color-workspace);
        color: var(--color-foreground);
        -webkit-font-smoothing: antialiased;
        font-feature-settings: 'cv11', 'ss01';
    }
    ::selection {
        background: color-mix(in oklab, var(--color-primary) 22%, transparent);
    }
}

/* Name kept for existing markup: Black Titanium primary is a MATTE black surface, not a gradient. */
@utility brand-gradient {
    background-color: #111214;
    background-image: none;
    color: #ffffff;
}
@utility tabular {
    font-variant-numeric: tabular-nums;
}
@utility surface {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-soft);
}
@utility surface-interactive {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-soft);
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
    &:hover {
        transform: translateY(-0.125rem);
        box-shadow: var(--shadow-lift);
    }
}
@utility scroll-thin {
    scrollbar-width: thin;
    scrollbar-color: #c9ccd1 transparent;
}

[x-cloak] {
    display: none !important;
}

/* Blue TEXT and icons use the accessible ink; blue fills (buttons, pills, indicators) keep the brand blue (same rule as the original). */
.text-primary {
    color: var(--color-primary-ink);
}

/* Skeleton shimmer and the pulsing ring used by loading / live states */
@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}
.shimmer {
    position: relative;
    overflow: hidden;
    background-color: var(--color-muted);
}
.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.7), transparent);
    animation: shimmer 1.4s infinite;
}
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}
.pulse-ring {
    animation: pulse-ring 1.8s ease-out infinite;
}

/* Dashboard map popups (Leaflet) */
.qw-map-popup { display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.35; color: var(--color-foreground); }
.qw-map-popup strong { font-size: 13px; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 8px 24px rgb(16 24 32 / 0.18); }
.leaflet-popup-content { margin: 12px 14px; }

/* Order detail: clean A4 print of the open order (read-only; the page behind is not printed). */
@media print {
    @page { size: A4; margin: 14mm; }
    html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
    body:has([data-print-order]) * { visibility: hidden !important; }
    body:has([data-print-order]) [data-print-order],
    body:has([data-print-order]) [data-print-order] * { visibility: visible !important; }
    [data-print-order] {
        position: absolute !important; inset: 0 auto auto 0 !important; width: 100% !important; max-width: none !important;
        max-height: none !important; transform: none !important; box-shadow: none !important; border-radius: 0 !important;
        overflow: visible !important; background: #fff !important;
    }
    [data-print-order] [data-no-print] { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ───────────── Navigation: matte Black Titanium (#111214), active item #303338 ───────────── */
.sidebar-surface {
    background: #111214;
}
.nav-active-surface {
    background: #303338;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04);
}

/* ───────────── Sign-in page: liquid glass ───────────── */
.lg-stage {
    color-scheme: dark;
    background: #060d16;
    color: #f5f9ff;
}
.lg-shade {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 52%, transparent 2%, rgba(3, 8, 15, 0.15) 40%, rgba(2, 6, 11, 0.58) 100%);
}
.lg-grain {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
}
.lg-appear {
    animation: lg-appear 1.1s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.lg-frame {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}
.lg-frame::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 28px;
    background: linear-gradient(135deg, #a8d9ff65, #ffffff0a 31%, #ffffff05 67%, #4ca4ff65);
    z-index: -1;
}
.lg-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(26px, 4vw, 42px);
    border-radius: 27px;
    background: linear-gradient(145deg, rgba(21, 38, 57, 0.8), rgba(8, 17, 29, 0.83));
    -webkit-backdrop-filter: blur(32px) saturate(150%);
    backdrop-filter: blur(32px) saturate(150%);
    box-shadow: 0 35px 95px #0009, inset 0 1px #ffffff26, inset 0 -1px #ffffff0c;
}
.lg-panel::after {
    content: '';
    position: absolute;
    left: -60%;
    top: -80%;
    width: 120%;
    height: 110%;
    background: linear-gradient(120deg, transparent 42%, #ffffff08 50%, transparent 57%);
    transform: rotate(20deg);
    animation: lg-shine 11s linear infinite;
    pointer-events: none;
}
@media (max-width: 650px) {
    .lg-panel {
        padding: 29px 25px;
    }
}
.lg-fade {
    animation: lg-fade 0.32s ease-out both;
}
.lg-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #54a7ff;
    box-shadow: 0 0 14px #54a7ff;
    animation: lg-pulse 2.7s infinite;
}
.lg-input {
    width: 100%;
    height: 49px;
    border-radius: 12px;
    background: #071320aa;
    border: 1px solid #ffffff1b;
    color: #fff;
    padding: 0 15px;
    font-size: 16px; /* 16px stops iOS from zooming the page on focus */
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
@media (min-width: 651px) {
    .lg-input {
        font-size: 14px;
    }
}
.lg-input::placeholder {
    color: #65788e;
}
.lg-input:focus {
    border-color: #429fff;
    box-shadow: 0 0 0 4px #258cff1c, 0 0 24px #248bff1a;
    background: #091b2e;
}
.lg-input[aria-invalid='true'] {
    border-color: #ff9a8d99;
}
.lg-input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0 1000px #0a1a2b inset;
}
.lg-eye {
    position: absolute;
    right: 7px;
    top: 7px;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #91a9c1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.lg-eye:hover {
    background: #ffffff10;
    color: #fff;
}
.lg-eye:focus-visible,
.lg-submit:focus-visible {
    outline: 2px solid #79b9ff;
    outline-offset: 2px;
}
.lg-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    width: 100%;
    border: 1px solid #67b6ff70;
    border-radius: 12px;
    background: linear-gradient(110deg, #1274d9, #1a86eb 54%, #1274d9); /* white text stays >= 4.5:1 */
    background-size: 200% 100%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px #1687f444, inset 0 1px #ffffff55;
    transition: transform 0.25s, box-shadow 0.25s;
    animation: lg-buttonflow 6s ease infinite;
}
.lg-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px #1687f466, inset 0 1px #ffffff55;
}
.lg-submit:active:not(:disabled) {
    transform: translateY(0);
}
.lg-submit:disabled {
    opacity: 0.8;
    cursor: wait;
}
.lg-shake {
    animation: lg-shake 0.36s ease-out both;
}
@keyframes lg-appear {
    from {
        opacity: 0;
        transform: translateY(42px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes lg-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes lg-pulse {
    50% {
        opacity: 0.45;
        box-shadow: 0 0 4px #54a7ff;
    }
}
@keyframes lg-shine {
    0%,
    30% {
        transform: translateX(-110%) rotate(20deg);
    }
    60%,
    100% {
        transform: translateX(190%) rotate(20deg);
    }
}
@keyframes lg-buttonflow {
    50% {
        background-position: 100% 0;
    }
}
@keyframes lg-shake {
    20% {
        transform: translateX(-3px);
    }
    50% {
        transform: translateX(3px);
    }
    80% {
        transform: translateX(-1px);
    }
}
@keyframes spin-slow {
    to {
        transform: rotate(360deg);
    }
}
.qw-spin {
    animation: spin-slow 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .lg-appear,
    .lg-fade,
    .lg-shake,
    .lg-panel::after,
    .lg-submit,
    .lg-pulse-dot {
        animation: none !important;
    }
}
