@import url("variables.css?v=20260212a");

* {
    box-sizing: border-box;
    outline: none;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 13px;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* APP SHELL */
.app-shell {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-app);
    overflow: hidden;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 20;
}

.sidebar-brand {
    height: 64px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--slate-800);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.sidebar-brand i {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 14px;
}

.sidebar-email {
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    height: 36px;
}

.main-content {
    flex: 1;
    position: relative;
    height: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.nav-item {
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--slate-100);
    color: var(--slate-800);
}

.nav-item.active {
    border-color: var(--primary-light);
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    width: 16px;
    text-align: center;
}

/* APP LOADER */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.app-loader-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 999px;
    animation: spin 0.8s linear infinite;
}

.app-loader-label {
    margin-top: 14px;
    color: var(--slate-700);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* LOGIN */
.login-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(360px, 460px);
    gap: 18px;
    padding: 24px;
    background: var(--slate-50);
}

.login-left {
    padding: 40px;
    color: var(--slate-800);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    font-size: 12px;
    margin-bottom: 18px;
}

.login-hero-text {
    margin: 0 0 14px;
    color: var(--slate-900);
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.06;
    letter-spacing: -0.5px;
    font-weight: 800;
}

.login-subtext {
    margin: 0;
    max-width: 460px;
    color: var(--slate-500);
    line-height: 1.55;
    font-size: 14px;
}

.login-right {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.login-form-wrapper {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.login-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 999px;
    background: var(--slate-900);
    border: 1px solid var(--slate-700);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.login-title {
    text-align: center;
    margin: 0 0 8px;
    color: var(--slate-900);
    font-size: 21px;
    font-weight: 800;
}

.login-subtitle {
    text-align: center;
    margin: 0 0 22px;
    color: var(--slate-500);
    font-size: 13px;
}

.login-divider {
    margin: 14px 0;
    position: relative;
    text-align: center;
}

.login-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--border);
}

.login-divider span {
    position: relative;
    background: var(--white);
    padding: 0 10px;
    color: var(--slate-400);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.btn-login {
    width: 100%;
    height: 46px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-login:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-google {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-google:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
}

/* EMBEDDED MODE */
body.embedded-mode .sidebar,
body.embedded-mode .store-list-panel,
body.embedded-mode .location-overview,
body.embedded-mode .inspector-header button {
    display: none !important;
}

body.embedded-mode .main-content,
body.embedded-mode .monitor-layout,
body.embedded-mode .detail-panel,
body.embedded-mode .channel-inspector {
    background: var(--white);
}

body.embedded-mode .monitor-layout {
    position: static;
    display: block;
    height: 100%;
}

body.embedded-mode .detail-panel {
    display: block;
    height: 100%;
}

body.embedded-mode .channel-inspector {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    height: 100%;
    position: static;
}

body.embedded-mode .inspector-scroll {
    padding: 18px;
}

body.embedded-mode .panel-card,
body.embedded-mode .channel-inspector .card {
    border: none;
    box-shadow: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

/* GLOBAL COMPONENTS */
.btn {
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--white);
    color: var(--slate-700);
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline {
    border-color: var(--border);
    background: var(--white);
    color: var(--slate-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff5f5;
}

.btn-danger:hover {
    border-color: #fca5a5;
    background: #fee2e2;
}

.btn-success {
    border-color: #a7f3d0;
    color: #047857;
    background: #ecfdf5;
}

.btn-success:hover {
    border-color: #6ee7b7;
}

.btn-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--slate-500);
}

.btn-icon:hover {
    background: var(--slate-100);
    color: var(--slate-800);
}

.btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
}

.btn-xs {
    height: 28px;
    padding: 0 8px;
    font-size: 10px;
}

.input {
    height: 36px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 11px;
    background: var(--white);
    color: var(--slate-800);
    font-size: 12px;
    font-family: var(--font-main);
    transition: all 0.12s ease;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    width: min(560px, 92vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    height: 52px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 800;
    color: var(--slate-700);
}

.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: var(--slate-50);
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--white);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* TOASTS */
.toast-container {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--slate-700);
    box-shadow: var(--shadow-md);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fade-up 0.18s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--primary);
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.info i {
    color: var(--primary);
}

/* HOURS */
.hours-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--slate-100);
}

.hours-grid:last-child {
    border-bottom: 0;
}

.day-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 118px;
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-input {
    width: 86px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--slate-800);
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
    text-align: center;
}

.time-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* TRACKER */
.tracker-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 390px;
    transform: translateX(110%);
    transition: transform 0.25s ease;
    background: var(--white);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 24px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.tracker-drawer.open {
    transform: translateX(0);
}

.tracker-header {
    height: 72px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tracker-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--slate-50);
}

.tracker-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
}

.tracker-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--slate-200);
}

.tracker-card.active::before {
    background: var(--primary);
}

.tracker-card.success::before {
    background: var(--success);
}

.tracker-card.error::before {
    background: var(--danger);
}

.tracker-store-name {
    color: var(--slate-800);
    font-size: 12px;
    font-weight: 800;
    margin-right: 8px;
}

.tracker-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tracker-step {
    background: var(--slate-100);
    color: var(--slate-500);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tracker-step.done {
    background: var(--success-bg);
    color: #047857;
}

.tracker-step.active {
    background: var(--primary-light);
    color: var(--primary);
}

.tracker-logs {
    margin-top: 8px;
    background: var(--slate-100);
    border-radius: 4px;
    padding: 8px;
    color: var(--slate-600);
    font-size: 10px;
    line-height: 1.35;
    max-height: 120px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.log-line {
    margin-bottom: 2px;
}

/* LIGHTWEIGHT UTILITIES USED ACROSS TEMPLATES */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 600;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.text-center {
    text-align: center;
}

.text-xs {
    font-size: 11px;
}

.text-sm {
    font-size: 12px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 21px;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.5px;
}

.text-muted {
    color: var(--text-muted);
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mb-10 {
    margin-bottom: 40px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.p-4 {
    padding: 16px;
}

.p-3 {
    padding: 12px;
}

.p-2 {
    padding: 8px;
}

.p-5 {
    padding: 20px;
}

.p-6 {
    padding: 24px;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-2 {
    padding-left: 8px;
    padding-right: 8px;
}

.py-0\.5 {
    padding-top: 2px;
    padding-bottom: 2px;
}

.mx-1 {
    margin-left: 4px;
    margin-right: 4px;
}

.mr-1 {
    margin-right: 4px;
}

.mr-2 {
    margin-right: 8px;
}

.w-16 {
    width: 64px;
}

.w-10 {
    width: 40px;
}

.w-4 {
    width: 16px;
}

.w-20 {
    width: 80px;
}

.w-24 {
    width: 96px;
}

.w-32 {
    width: 128px;
}

.h-8 {
    height: 32px;
}

.h-10 {
    height: 40px;
}

.h-4 {
    height: 16px;
}

.h-14 {
    height: 56px;
}

.h-20 {
    height: 80px;
}

.ml-auto {
    margin-left: auto;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: minmax(0, 1fr);
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.min-w-0 {
    min-width: 0;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.block {
    display: block;
}

.cursor-pointer {
    cursor: pointer;
}

.space-y-2 > * + * {
    margin-top: 8px;
}

.space-y-3 > * + * {
    margin-top: 12px;
}

.space-y-0 > * + * {
    margin-top: 0;
}

.border {
    border: 1px solid var(--border);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.border-l-4 {
    border-left: 4px solid var(--border);
}

.border-gray-200 {
    border-color: var(--slate-200);
}

.border-gray-100 {
    border-color: var(--slate-100);
}

.border-red-100 {
    border-color: #fecaca;
}

.border-l-purple-500 {
    border-left-color: var(--primary);
}

.border-l-amber-500 {
    border-left-color: #f59e0b;
}

.border-l-green-500 {
    border-left-color: #22c55e;
}

.border-l-indigo-500 {
    border-left-color: var(--primary);
}

.border-l-slate-500 {
    border-left-color: var(--slate-500);
}

.border-l-orange-500 {
    border-left-color: #f97316;
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 999px;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.z-10 {
    z-index: 10;
}

.bg-white {
    background: var(--white);
}

.bg-gray-50 {
    background: var(--slate-50);
}

.bg-green-100 {
    background: #dcfce7;
}

.bg-red-100 {
    background: #fee2e2;
}

.bg-red-50 {
    background: #fef2f2;
}

.bg-orange-100 {
    background: #ffedd5;
}

.bg-orange-50 {
    background: #fff7ed;
}

.bg-black {
    background: #0f172a;
}

.bg-gray-100 {
    background: var(--slate-100);
}

.bg-gray-400 {
    background: var(--slate-400);
}

.bg-orange-500 {
    background: var(--warning);
}

.bg-slate-700 {
    background: var(--slate-700);
}

.text-gray-900 {
    color: var(--slate-900);
}

.text-gray-800 {
    color: var(--slate-800);
}

.text-gray-700 {
    color: var(--slate-700);
}

.text-gray-600 {
    color: var(--slate-600);
}

.text-gray-500 {
    color: var(--slate-500);
}

.text-gray-400 {
    color: var(--slate-400);
}

.text-gray-300 {
    color: var(--slate-300);
}

.text-indigo-600 {
    color: var(--primary);
}

.text-indigo-500 {
    color: var(--primary);
}

.text-green-500 {
    color: var(--success);
}

.text-green-700 {
    color: #15803d;
}

.text-green-600 {
    color: #16a34a;
}

.text-red-500 {
    color: var(--danger);
}

.text-red-600 {
    color: #dc2626;
}

.text-red-700 {
    color: #b91c1c;
}

.text-orange-500 {
    color: #f97316;
}

.text-orange-600 {
    color: #ea580c;
}

.text-orange-800 {
    color: #9a3412;
}

.text-amber-700 {
    color: #b45309;
}

.text-purple-600 {
    color: var(--primary);
}

.text-slate-700 {
    color: var(--slate-700);
}

.text-slate-500 {
    color: var(--slate-500);
}

.text-white {
    color: var(--white);
}

.text-2xl {
    font-size: 24px;
}

.text-3xl {
    font-size: 30px;
}

.text-4xl {
    font-size: 36px;
}

.text-\[10px\] {
    font-size: 10px;
}

.text-\[11px\] {
    font-size: 11px;
}

.text-\[8px\] {
    font-size: 8px;
}

/* ANIMATION */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: 0 28px 35px -28px rgba(15, 23, 42, 0.45);
}

/* RESPONSIVE */
@media (max-width: 1080px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .login-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .login-left {
        display: none;
    }

    .app-shell {
        padding: 10px;
        gap: 10px;
    }
}
