/* Jibu app shell — multi-business POS-style theme */
:root {
    --brand-primary: #1a5c3a;
    --brand-primary-dark: #13442b;
    --brand-primary-light: #2d7a52;
    --app-bg: #f4f6f5;
    --app-surface: #ffffff;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-border: #e5e7eb;
    --sidebar-width: 260px;
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
}

body.app-body::before {
    display: none;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.app-sidebar-brand {
    padding: 1.35rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.app-sidebar-brand .brand-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.app-sidebar-brand .brand-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-sidebar-brand h1 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.app-sidebar-brand p {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.app-nav-section {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
    padding: 0.75rem 0.65rem 0.35rem;
    margin: 0;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 0.85rem;
    margin-bottom: 0.2rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav-link i {
    width: 18px;
    text-align: center;
    opacity: 0.9;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-nav-link.active {
    background: #fff;
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.app-sidebar-footer {
    padding: 1rem 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    opacity: 0.75;
    text-align: center;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-topbar h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--app-text);
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.app-topbar .btn-brand {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem;
}

.app-topbar .btn-brand:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: #fff;
}

.app-topbar .btn-outline-brand {
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    background: #fff;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.app-topbar-meta {
    font-size: 0.85rem;
    color: var(--app-muted);
    white-space: nowrap;
}

.app-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--app-text);
}

.app-content {
    padding: 1.25rem 1.5rem 2rem;
}

.welcome-banner {
    background: var(--brand-primary);
    color: #fff;
    border-radius: 12px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
}

.welcome-banner h3 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.welcome-banner p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.92rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-card h4 {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: var(--app-muted);
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--app-text);
    line-height: 1.2;
}

.stat-card .stat-sub {
    font-size: 0.78rem;
    color: var(--app-muted);
    margin-top: 0.2rem;
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon.green { background: #dcfce7; color: #15803d; }
.stat-icon.orange { background: #ffedd5; color: #c2410c; }
.stat-icon.red { background: #fee2e2; color: #b91c1c; }
.stat-icon.blue { background: #dbeafe; color: #1d4ed8; }

.alert-banner {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.module-card {
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.module-card i {
    font-size: 1.5rem;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.module-card h6 {
    margin: 0 0 0.25rem;
    font-size: 0.92rem;
}

.module-card p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--app-muted);
}

.app-content .card {
    border-radius: 12px;
    border: 1px solid var(--app-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    background: var(--app-surface);
}

.app-content .card::before {
    display: none;
}

.app-content .card-header {
    background: #f9fafb;
    color: var(--app-text);
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
}

.app-content .card:hover {
    transform: none;
}

/* Login split screen */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0;
    background: #f4f6f5;
}

.login-brand-panel {
    background: var(--brand-primary, #1a5c3a);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-brand-panel .deco-circle {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-panel .deco-circle.c1 { width: 180px; height: 180px; top: 8%; left: 6%; }
.login-brand-panel .deco-circle.c2 { width: 120px; height: 120px; top: 42%; left: 12%; }
.login-brand-panel .deco-circle.c3 { width: 220px; height: 220px; bottom: -40px; right: -30px; }

.login-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 360px;
}

.login-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    overflow: hidden;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-brand-inner h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
}

.login-brand-inner .subtitle {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.login-brand-inner .tagline {
    font-size: 0.95rem;
    opacity: 0.85;
}

.login-clock {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.9;
    z-index: 1;
    width: 100%;
    padding: 0 1rem;
}

.login-clock hr {
    border-color: rgba(255, 255, 255, 0.35);
    margin: 0 auto 0.75rem;
    max-width: 200px;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.login-card .lead {
    color: var(--app-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 0.88rem;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}

.login-card .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

.password-wrap {
    position: relative;
}

.password-wrap .toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--app-muted);
    cursor: pointer;
    padding: 0;
}

.btn-login {
    width: 100%;
    background: var(--brand-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.7rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.btn-login:hover {
    background: var(--brand-primary-dark);
    color: #fff;
}

.login-card footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border);
    font-size: 0.78rem;
    color: var(--app-muted);
}

@media (max-width: 992px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: 280px;
        padding: 2rem 1.5rem 4rem;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-main {
        margin-left: 0;
    }
}
