/* POStrust - Professional Stylesheet */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --primary-subtle: #eef2ff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #4f46e5;
    --sidebar-text: #94a3b8;
    --sidebar-text-bright: #e2e8f0;
    --sidebar-width: 195px;
    --topbar-height: 50px;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --body-bg: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --bs-border-radius: 3px;
    --bs-border-radius-sm: 3px;
    --bs-border-radius-lg: 3px;
    --bs-border-radius-xl: 3px;
    --bs-border-radius-xxl: 3px;
}

/* ===== RESET & GLOBALS ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global component radius */
.card                           { border-radius: 3px; }
.card-header:first-child        { border-radius: 3px 3px 0 0; }
.card-footer:last-child         { border-radius: 0 0 3px 3px; }
.modal-content                  { border-radius: 3px; }
.dropdown-menu                  { border-radius: 3px; }
.alert                          { border-radius: 3px; }
.toast                          { border-radius: 3px; }
.list-group                     { border-radius: 3px; }
.list-group-item:first-child    { border-radius: 3px 3px 0 0; }
.list-group-item:last-child     { border-radius: 0 0 3px 3px; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* --- Brand Panel (Left) --- */
.login-brand-panel {
    display: none;
    width: 48%;
    background: linear-gradient(160deg, #030329 0%, #0a0a3a 35%, #12124a 65%, #1a1a5c 100%);
    color: #fff;
    padding: 3rem 3.5rem;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(79, 70, 229, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(99, 102, 241, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.04);
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.03);
}

@media (min-width: 992px) {
    .login-brand-panel {
        display: flex;
    }
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.login-brand-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.75rem;
}

.login-brand-logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.login-brand-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand-tagline {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 360px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.login-feature-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 3px;
    font-size: 1.125rem;
    color: #a5b4fc;
}

.login-feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.login-feature-text strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.login-feature-text span {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 2rem;
    color: #475569;
    font-size: 0.75rem;
}

.login-brand-footer a {
    color: #64748b;
    text-decoration: none;
}

.login-brand-footer a:hover {
    color: #a5b4fc;
}

/* --- Form Panel (Right) --- */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.login-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/static/img/login.jpg') center/cover no-repeat;
    opacity: 0.35;
    z-index: 0;
}

.login-form-container {
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .login-form-panel {
        padding: 3rem;
    }
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.login-mobile-logo img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
}

.login-mobile-brand {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-form-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
}

.login-form-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Alerts --- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 3px;
    color: #991b1b;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-alert strong {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 0.125rem;
}

.login-alert i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.login-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.login-alert-success i {
    color: #16a34a;
}

/* --- Form Fields --- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.login-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color var(--transition);
    z-index: 1;
}

.login-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 3px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    outline: none;
}

.login-input-with-icon {
    padding-left: 2.625rem;
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.login-input:focus ~ .login-input-icon,
.login-input-wrap:focus-within .login-input-icon {
    color: var(--primary);
}

.login-input::placeholder {
    color: #94a3b8;
    font-size: 0.8125rem;
}

.login-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: color var(--transition);
    z-index: 1;
}

.login-password-toggle:hover {
    color: var(--text-primary);
}

/* --- Submit Button --- */
.login-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    margin-top: 0.375rem;
    letter-spacing: 0.01em;
}

.login-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Forgot Link --- */
.login-forgot {
    text-align: center;
    margin-top: 1.25rem;
}

.login-forgot a {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.login-forgot a:hover {
    color: var(--primary);
}

/* --- Form Footer (mobile copyright) --- */
.login-form-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.6875rem;
}

.login-form-footer a {
    color: #94a3b8;
    text-decoration: none;
}

.login-form-footer a:hover {
    color: var(--primary);
}

@media (min-width: 992px) {
    .login-form-footer {
        display: none;
    }
}

/* --- Back Link --- */
.login-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: color var(--transition);
}

.login-back-link:hover {
    color: var(--primary);
}

/* --- Legacy/unused cleanup --- */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-footer p { margin: 0; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #030329 0%, #0a0a2e 100%);
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Brand */
.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0.75rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}

.sidebar-brand-icon {
    flex-shrink: 0;
}

.sidebar-logo {
    height: 36px;
    width: 36px;
    object-fit: contain;
    border-radius: 3px;
    background: none;
    box-shadow: none;
    mix-blend-mode: lighten;
}

.sidebar-brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.0625rem;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    color: rgba(255,255,255,0.5);
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.sidebar-close {
    background: none;
    border: none;
    color: #475569;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    transition: color var(--transition);
}

.sidebar-close:hover {
    color: #fff;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Section label */
.sidebar-section-label {
    display: block;
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
}

/* Top-level sidebar link */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 1px 0.625rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    font-weight: 500;
    gap: 0.75rem;
    border-radius: 3px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.sidebar-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sidebar-link.active i,
.sidebar-link:hover i {
    opacity: 1;
}

.sidebar-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* POS Terminal highlight */
.sidebar-link-highlight {
    background: rgba(79, 70, 229, 0.08);
}

.sidebar-link-highlight:hover {
    background: rgba(79, 70, 229, 0.15);
}

.sidebar-badge {
    font-size: 0.575rem;
    padding: 0.125rem 0.4rem;
    border-radius: 3px;
    letter-spacing: 0.04em;
    font-weight: 700;
    margin-left: auto;
    text-transform: uppercase;
    line-height: 1.4;
}

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.04);
    margin: 0.375rem 1.25rem;
}

/* Sidebar Group (collapsible) */
.sidebar-group {
    margin: 1px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 1.25rem);
    margin: 0 0.625rem;
    padding: 0.5rem 0.625rem;
    background: none;
    border: none;
    border-radius: 3px;
    color: rgba(255,255,255,0.75);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sidebar-group-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-group-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-group-left i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sidebar-group-toggle:hover .sidebar-group-left i {
    opacity: 1;
}

.sidebar-group-arrow {
    font-size: 0.625rem;
    transition: transform 0.25s ease, opacity 0.2s ease;
    opacity: 0;
}

.sidebar-group-toggle:hover .sidebar-group-arrow {
    opacity: 0.6;
}

.sidebar-group.open .sidebar-group-arrow {
    transform: rotate(180deg);
    opacity: 0.6;
}

.sidebar-group.open .sidebar-group-toggle {
    color: #fff;
}

.sidebar-group.open .sidebar-group-left i {
    opacity: 1;
}

/* Sidebar Sub-menu */
.sidebar-group-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.sidebar-group.open .sidebar-group-menu {
    max-height: 3000px;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.4375rem 1rem 0.4375rem 3.25rem;
    margin: 0 0.625rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 450;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 3px;
}

.sidebar-sublink::before {
    content: '';
    position: absolute;
    left: 2rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transition: all 0.2s ease;
}

.sidebar-sublink:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.sidebar-sublink:hover::before {
    background: rgba(255,255,255,0.6);
}

.sidebar-sublink.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.sidebar-sublink.active::before {
    background: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,0.4);
    width: 5px;
    height: 5px;
}

/* Sidebar Footer / User */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 0.75rem 0.875rem;
    background: rgba(0,0,0,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.375rem;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.04);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 3px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-avatar span {
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    color: #c8d3e2;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: #4f5b73;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    background: var(--body-bg);
    transition: margin-left var(--transition);
}

.main-content.expanded {
    margin-left: 0;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-height);
    background: linear-gradient(180deg, #030329 0%, #0a0a2e 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1020;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: left var(--transition);
}

.main-content.expanded .topbar {
    left: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: background var(--transition);
}

.hamburger:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Centered tenant name */
.topbar-center {
    position: absolute;
    left: 45%;
    transform: translateX(-50%);
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.topbar-tenant-name {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    font-size: 0.65rem;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    max-width: 150px;
}

/* Topbar buttons */
.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.topbar-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* User dropdown */
.topbar-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.75rem 0.3125rem 0.3125rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.topbar-user-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}

.topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-user-avatar span {
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

.topbar-user-menu {
    min-width: 240px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem 0;
}

.topbar-user-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.topbar-user-menu .dropdown-item i {
    width: 18px;
    text-align: center;
}

/* ===== CONTENT ===== */
.content-wrapper {
    padding: 1.5rem 2rem;
}

/* ===== FOOTER ===== */
.app-footer {
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}
.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.app-footer a:hover {
    text-decoration: underline;
}

/* ===== PAGE HEADERS ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--primary-subtle);
    color: var(--primary);
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.page-header-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0;
    font-weight: 400;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-header-actions .btn {
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.4375rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* ===== STAT CARDS ===== */
.stat-card {
    border: none;
    border-radius: 3px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--surface);
    overflow: hidden;
    position: relative;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card .card-body {
    padding: 1.25rem 1.375rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

/* ===== TABLE CARDS ===== */
.table-card {
    border: none;
    border-radius: 3px;
    box-shadow: var(--shadow);
    overflow: hidden;
    background: var(--surface);
}

.table-card .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card .table {
    margin: 0;
}

.table-card .table th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    user-select: none;
}

.table-card .table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.8125rem;
    border-color: #f1f5f9;
    transition: background 0.1s ease;
}

.table-card .table tbody tr {
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.table-card .table tbody tr:hover {
    background: #f8fafc;
    border-left-color: var(--primary);
}

.table-card .table tfoot td,
.table-card .table tfoot th {
    background: var(--surface-muted);
    font-weight: 600;
}

/* Row number column */
.table-card .table .row-num {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    width: 40px;
    text-align: center;
}

/* Action column buttons */
.table-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.table-actions .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 3px !important;
    transition: all 0.15s ease;
}

.table-actions .btn:hover {
    transform: scale(1.1);
}

/* Table empty state */
.table-empty {
    text-align: center;
    padding: 3rem 2rem !important;
}

.table-empty-icon {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    display: block;
}

.table-empty-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.table-empty-text {
    color: #94a3b8;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

/* Table icon placeholder */
.table-icon-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Table result count */
.table-result-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--surface-muted);
    padding: 0.25rem 0.625rem;
    border-radius: 3px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    background: var(--surface);
    border-radius: 3px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

.filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px 3px 0 0;
}

.filter-bar .form-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
    font-size: 0.8125rem;
    border-color: var(--border-color);
}

.filter-bar .btn {
    font-size: 0.8125rem;
    font-weight: 600;
}

.filter-bar .btn-clear {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.filter-bar .btn-clear:hover {
    color: var(--primary);
}

/* ===== FORM STYLES ===== */
.form-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}
.form-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.form-section-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e8ecf4 100%);
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-section-header::after { display: none; }
.form-section-header .section-icon {
    width: 36px;
    height: 36px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}
.form-section-header h6 {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}
.form-section-header p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
}
.form-section-body {
    padding: 20px;
}

/* Form labels */
.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 4px;
}
.required-dot {
    color: #ef4444;
    font-weight: 700;
}

/* Form inputs */
.form-control,
.form-select {
    border-radius: 3px;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-control:hover,
.form-select:hover {
    border-color: #a5b4fc;
}
.form-control.bg-light {
    background-color: #f8fafc !important;
}
.form-control::placeholder {
    color: #94a3b8;
    font-size: 0.85rem;
}
textarea.form-control {
    min-height: 80px;
}

/* Input group */
.input-group-text {
    border-radius: 3px 0 0 3px;
    background: #f1f5f9;
    border: 1px solid #d1d5db;
    border-right: none;
    color: #64748b;
    font-size: 0.85rem;
}
.input-group .form-control,
.input-group .form-select {
    border-radius: 0 3px 3px 0;
}

/* Step indicator */
.step-indicator {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.step-badge {
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.step-badge i {
    font-size: 0.5rem;
}

/* Auto-generated tag */
.auto-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 4px;
}

/* Form hint */
.form-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* Form help text */
.form-text {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Form check */
.form-check {
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    background: #fafbfc;
    border: 1px solid #f0f1f3;
    border-radius: 3px;
    margin-top: 0.25rem;
    transition: all 0.15s ease;
}
.form-check:hover {
    border-color: #c7d2fe;
    background: #f5f3ff;
}

/* Error styling */
.text-danger.small {
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 20px;
    margin-top: 0;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 3px 3px;
}
.form-actions .btn {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 3px;
}

/* Actions card (sticky sidebar submit) */
.actions-card {
    position: sticky;
    top: 80px;
}

/* Save button gradient */
.btn-save-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    padding: 12px 24px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    transition: all 0.3s;
}
.btn-save-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    color: #fff;
}
.btn-cancel {
    border-radius: 3px;
    padding: 12px 24px;
    font-weight: 500;
}

/* Photo upload area */
.photo-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 3px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}
.photo-upload-area:hover {
    border-color: #6366f1;
    background: #f5f3ff;
}
.photo-upload-area .avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #6366f1;
    font-size: 28px;
}

/* Crispy forms enhancements */
.form-section form > div > div.mb-3 {
    margin-bottom: 1rem !important;
}

/* ===== DETAIL CARDS ===== */
.detail-card {
    border: none;
    border-radius: 3px;
    box-shadow: var(--shadow);
    background: var(--surface);
    overflow: hidden;
}

.detail-card .detail-header {
    padding: 0.875rem 1.125rem;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card .detail-header i {
    color: var(--primary);
    font-size: 0.9375rem;
}

.detail-card .detail-body {
    padding: 1.125rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-right: 1rem;
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

/* Detail summary stat row */
.detail-stats {
    display: flex;
    gap: 0;
    background: var(--surface-muted);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.detail-stat {
    flex: 1;
    text-align: center;
    padding: 0.875rem 0.5rem;
    border-right: 1px solid var(--border-color);
}

.detail-stat:last-child {
    border-right: none;
}

.detail-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.detail-stat-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    margin-top: 0.125rem;
}

/* ===== STATUS BADGES ===== */
.badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    letter-spacing: 0.02em;
}

.badge-status {
    padding: 0.35rem 0.65rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.stock-ok { color: #059669; font-weight: 600; }
.stock-low { color: #d97706; font-weight: 600; }
.stock-out { color: #dc2626; font-weight: 600; }

/* ===== BUTTON OVERRIDES ===== */
.btn {
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

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

.btn-success:hover { box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3); }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3); }
.btn-warning:hover { box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3); }

/* Quick action buttons */
.quick-actions .btn {
    border-radius: 3px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination-showing strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination-per-page-form .form-select-sm {
    width: auto;
    min-width: 60px;
    padding: 0.2rem 1.75rem 0.2rem 0.5rem;
    font-size: 0.8125rem;
    border-color: var(--border-color);
}

.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    min-width: 36px;
    text-align: center;
    transition: all 0.15s ease;
    border-radius: 3px !important;
}

.pagination .page-link:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: transparent;
}

@media (max-width: 576px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .pagination-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    .pagination { justify-content: center; }
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 3px;
    font-size: 0.8125rem;
    border: none;
    font-weight: 500;
}

.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger, .alert-error { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* ===== DROPDOWN ===== */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-size: 0.8125rem;
}

.dropdown-item {
    padding: 0.4375rem 1rem;
    transition: background 0.15s ease;
    font-size: 0.8125rem;
}

/* ===== TABS ===== */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.625rem 1rem;
    transition: all 0.15s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ===== CODE TAGS ===== */
code {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: #f1f5f9;
    border-radius: 3px;
    color: var(--primary-dark);
    font-weight: 500;
}

/* ===== RECEIPT ===== */
.receipt-container {
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #fff;
    padding: 20px;
    border: 1px dashed #ccc;
}

.receipt-container .receipt-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
}

.receipt-container .receipt-items {
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-container .receipt-total {
    font-weight: bold;
    font-size: 14px;
}

.receipt-container .receipt-footer {
    text-align: center;
    margin-top: 15px;
    border-top: 1px dashed #000;
    padding-top: 10px;
    font-size: 11px;
}

/* ===== SIDEBAR OVERLAY (MOBILE) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1025;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar {
        left: 0;
    }
    .topbar-tenant-name {
        font-size: 0.6rem;
        max-width: 100px;
    }
    .content-wrapper {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 1rem;
    }
    .topbar {
        padding: 0 1rem;
    }
    .login-form-panel {
        padding: 1.5rem;
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .page-header-actions {
        justify-content: flex-end;
    }
    .detail-stats {
        flex-direction: column;
    }
    .detail-stat {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .topbar, .no-print, .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
}