/* ==========================================================================
   Oracle Fusion Cloud / Redwood Design System - ShopChat Admin Console
   ========================================================================== */

:root {
    /* Redwood Neutral Canvas & Surfaces */
    --redwood-canvas: #f7f6f3;
    --redwood-surface: #ffffff;
    --redwood-surface-subtle: #f4f2ee;
    --redwood-surface-active: #ebe7e0;
    --redwood-border: #e3dfd6;
    --redwood-border-subtle: #eeebe3;
    --redwood-border-strong: #cac4b7;

    /* Redwood Darks (Espresso / Charcoal) */
    --redwood-dark-base: #1c1917;
    --redwood-dark-surface: #1c1917;
    --redwood-dark-elevated: #26221f;
    --redwood-dark-border: #2e2a25;
    --redwood-dark-border-subtle: #2e2a25;

    /* Redwood Signature Accents */
    --redwood-red: #c74634;
    --redwood-red-hover: #ad3b2c;
    --redwood-red-active: #963124;
    --redwood-red-subtle: #fbece9;
    --redwood-red-text: #a82e1e;

    --redwood-amber: #d97706;
    --redwood-amber-hover: #b45309;
    --redwood-amber-subtle: #fef3c7;
    --redwood-amber-text: #92400e;

    --redwood-teal: #0d7d87;
    --redwood-teal-hover: #0a646c;
    --redwood-teal-subtle: #e0f2f1;
    --redwood-teal-text: #065e66;

    --redwood-green: #2e7d32;
    --redwood-green-hover: #256628;
    --redwood-green-subtle: #e8f5e9;
    --redwood-green-text: #1b5e20;

    --redwood-navy: #1e293b;
    --redwood-navy-subtle: #f1f5f9;

    /* Redwood Typography */
    --redwood-text-primary: #161513;
    --redwood-text-secondary: #58544e;
    --redwood-text-muted: #857f75;
    --redwood-text-on-dark: #fbfaf8;
    --redwood-text-on-dark-secondary: #aba59a;
    --redwood-text-on-dark-muted: #7d776c;

    /* Elevation & Shadows */
    --redwood-shadow-xs: 0 1px 2px rgba(22, 21, 19, 0.04);
    --redwood-shadow-sm: 0 2px 4px rgba(22, 21, 19, 0.05), 0 1px 2px rgba(22, 21, 19, 0.03);
    --redwood-shadow-md: 0 4px 14px rgba(22, 21, 19, 0.07), 0 2px 4px rgba(22, 21, 19, 0.03);
    --redwood-shadow-lg: 0 10px 30px rgba(22, 21, 19, 0.09), 0 4px 8px rgba(22, 21, 19, 0.04);
    --redwood-shadow-xl: 0 20px 48px rgba(22, 21, 19, 0.14);

    /* Radii */
    --redwood-radius-sm: 6px;
    --redwood-radius-md: 10px;
    --redwood-radius-lg: 14px;
    --redwood-radius-xl: 20px;
    --redwood-radius-pill: 9999px;
}

/* Base Body Styling */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--redwood-canvas);
    color: var(--redwood-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--redwood-border-strong);
    border-radius: var(--redwood-radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--redwood-text-muted);
}

/* ==========================================================================
   Oracle Fusion Masthead & Global Header
   ========================================================================== */

.redwood-masthead {
    background-color: #ffffff;
    color: #1e293b;
    height: 56px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.redwood-brand-badge {
    width: 34px;
    height: 34px;
    background: var(--redwood-red);
    color: #ffffff;
    border-radius: var(--redwood-radius-sm);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(199, 70, 52, 0.3);
}

.redwood-system-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.redwood-system-subtitle {
    font-size: 0.68rem;
    color: #64748b;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 600;
}

.redwood-divider-vertical {
    width: 1px;
    height: 20px;
    background-color: #e2e8f0;
}

/* Global Search Bar (Modern Light Style) */
.redwood-search-pill {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--redwood-radius-pill);
    padding: 6px 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    max-width: 480px;
    width: 100%;
}

.redwood-search-pill:hover,
.redwood-search-pill:focus-within {
    background-color: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(199, 70, 52, 0.12);
}

.redwood-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #0f172a;
    font-size: 0.85rem;
    width: 100%;
}

.redwood-search-input::placeholder {
    color: #94a3b8;
}

.redwood-search-kbd {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #475569;
    font-size: 0.68rem;
    padding: 1px 6px;
    font-family: inherit;
    font-weight: 600;
}

/* Header Action Icons */
.redwood-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #475569;
    transition: all 0.15s ease;
}

.redwood-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* User Profile Chip */
.redwood-user-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--redwood-radius-pill);
    padding: 3px 12px 3px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.redwood-user-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.redwood-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c74634, #d97706);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Modern Navigator (Sidebar)
   ========================================================================== */

.redwood-sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.redwood-sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

.redwood-sidebar.sidebar-mini {
    width: 68px !important;
    min-width: 68px !important;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.redwood-sidebar.sidebar-mini .redwood-nav-section-title,
.redwood-sidebar.sidebar-mini .redwood-nav-link > span:not(.redwood-nav-icon),
.redwood-sidebar.sidebar-mini .sidebar-hide-mini {
    display: none !important;
}

.redwood-sidebar.sidebar-mini .redwood-nav-link {
    justify-content: center !important;
    padding: 10px 0 !important;
    margin: 4px 8px !important;
    gap: 0 !important;
}

.redwood-sidebar.sidebar-mini:hover {
    width: 260px !important;
    min-width: 260px !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 1040;
}

.redwood-sidebar.sidebar-mini:hover .redwood-nav-section-title,
.redwood-sidebar.sidebar-mini:hover .redwood-nav-link > span:not(.redwood-nav-icon),
.redwood-sidebar.sidebar-mini:hover .sidebar-hide-mini {
    display: block !important;
}

.redwood-sidebar.sidebar-mini:hover .redwood-nav-link {
    justify-content: flex-start !important;
    padding: 9px 18px !important;
    margin: 2px 10px !important;
    gap: 12px !important;
}

/* Mobile Offcanvas Sidebar Drawer & Backdrop */
.redwood-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1045 !important;
    animation: redwoodFadeIn 0.2s ease-out;
}

.redwood-sidebar-mobile {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: #ffffff !important;
    z-index: 1050 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    animation: redwoodSlideInLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .redwood-sidebar-mobile {
    left: auto !important;
    right: 0 !important;
    animation: redwoodSlideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes redwoodFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes redwoodSlideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes redwoodSlideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.main-content-canvas {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.redwood-nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #94a3b8;
    padding: 18px 20px 6px;
}

.redwood-nav-link {
    color: #475569;
    padding: 9px 18px;
    margin: 2px 10px;
    border-radius: var(--redwood-radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}

.redwood-nav-link:hover {
    color: #0f172a;
    background-color: #f8fafc;
}

.redwood-nav-link.active {
    color: #c74634;
    background-color: #fdf2f0;
    font-weight: 600;
}

.redwood-nav-link.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background-color: var(--redwood-red);
}

.redwood-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================================================
   Oracle Fusion Welcome Banner & Springboard Launchpad
   ========================================================================== */

.redwood-welcome-banner {
    background: linear-gradient(135deg, #1b1a18 0%, #292420 50%, #3a2a24 100%);
    border-radius: var(--redwood-radius-lg);
    padding: 28px 32px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--redwood-shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.redwood-welcome-banner::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 70, 52, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.redwood-welcome-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.redwood-welcome-subtitle {
    font-size: 0.92rem;
    color: var(--redwood-text-on-dark-secondary);
    max-width: 600px;
}

/* Springboard Tiles */
.redwood-springboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.redwood-springboard-tile {
    background-color: var(--redwood-surface);
    border: 1px solid var(--redwood-border);
    border-radius: var(--redwood-radius-md);
    padding: 20px;
    text-decoration: none;
    color: var(--redwood-text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--redwood-shadow-xs);
    position: relative;
}

.redwood-springboard-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--redwood-shadow-md);
    border-color: var(--redwood-border-strong);
    color: var(--redwood-text-primary);
}

.redwood-tile-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--redwood-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.tile-icon-red {
    background-color: var(--redwood-red-subtle);
    color: var(--redwood-red);
}

.tile-icon-teal {
    background-color: var(--redwood-teal-subtle);
    color: var(--redwood-teal);
}

.tile-icon-amber {
    background-color: var(--redwood-amber-subtle);
    color: var(--redwood-amber);
}

.tile-icon-green {
    background-color: var(--redwood-green-subtle);
    color: var(--redwood-green);
}

.redwood-tile-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--redwood-text-primary);
}

.redwood-tile-desc {
    font-size: 0.8rem;
    color: var(--redwood-text-secondary);
    line-height: 1.4;
}

.redwood-tile-action {
    margin-top: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--redwood-red);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   Redwood Cards & KPI Metrics
   ========================================================================== */

.redwood-card {
    background-color: var(--redwood-surface);
    border: 1px solid var(--redwood-border);
    border-radius: var(--redwood-radius-md);
    box-shadow: var(--redwood-shadow-xs);
    overflow: hidden;
}

.redwood-card-header {
    background-color: var(--redwood-surface);
    padding: 16px 20px;
    border-bottom: 1px solid var(--redwood-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.redwood-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--redwood-text-primary);
    margin: 0;
}

.redwood-card-body {
    padding: 20px;
}

/* Metric KPI Cards */
.redwood-kpi-card {
    background-color: var(--redwood-surface);
    border: 1px solid var(--redwood-border);
    border-radius: var(--redwood-radius-md);
    padding: 20px;
    box-shadow: var(--redwood-shadow-xs);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.redwood-kpi-card:hover {
    border-color: var(--redwood-border-strong);
    box-shadow: var(--redwood-shadow-sm);
}

.redwood-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--redwood-text-muted);
    margin-bottom: 6px;
}

.redwood-kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--redwood-text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* ==========================================================================
   Redwood Data Tables & Lists (100% Fluid & Responsive)
   ========================================================================== */

.redwood-table-wrapper,
.redwood-table-container {
    background: var(--redwood-surface);
    border: 1px solid var(--redwood-border);
    border-radius: var(--redwood-radius-md);
    box-shadow: var(--redwood-shadow-xs);
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 240px;
    -webkit-overflow-scrolling: touch;
}

.redwood-table {
    width: 100%;
    min-width: 760px;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* Custom sleek scrollbars for responsive tables */
.redwood-table-wrapper::-webkit-scrollbar,
.redwood-table-container::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.redwood-table-wrapper::-webkit-scrollbar-track,
.redwood-table-container::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: var(--redwood-surface-subtle);
}

.redwood-table-wrapper::-webkit-scrollbar-thumb,
.redwood-table-container::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--redwood-border-strong);
    border-radius: var(--redwood-radius-pill);
}

.redwood-table-wrapper::-webkit-scrollbar-thumb:hover,
.redwood-table-container::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--redwood-red);
}

.redwood-table thead th {
    background-color: var(--redwood-surface-subtle);
    color: var(--redwood-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--redwood-border);
    border-top: none;
    white-space: nowrap;
}

.redwood-table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--redwood-border-subtle);
    color: var(--redwood-text-primary);
    font-size: 0.88rem;
    vertical-align: middle;
}

.redwood-table tbody tr:last-child td {
    border-bottom: none;
}

.redwood-table tbody tr:hover td {
    background-color: #faf9f6;
}

/* ==========================================================================
   Redwood Status Badges & Pills
   ========================================================================== */

.badge-redwood {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--redwood-radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.2px;
}

.badge-redwood-active {
    background-color: var(--redwood-green-subtle);
    color: var(--redwood-green-text);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.badge-redwood-pending {
    background-color: var(--redwood-amber-subtle);
    color: var(--redwood-amber-text);
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-redwood-red {
    background-color: var(--redwood-red-subtle);
    color: var(--redwood-red-text);
    border: 1px solid rgba(199, 70, 52, 0.25);
}

.badge-redwood-teal {
    background-color: var(--redwood-teal-subtle);
    color: var(--redwood-teal-text);
    border: 1px solid rgba(13, 125, 135, 0.25);
}

.badge-redwood-neutral {
    background-color: var(--redwood-surface-subtle);
    color: var(--redwood-text-secondary);
    border: 1px solid var(--redwood-border);
}

/* ==========================================================================
   Redwood Buttons & Form Controls
   ========================================================================== */

.btn-redwood-primary {
    background-color: var(--redwood-red);
    color: #ffffff;
    border: 1px solid var(--redwood-red);
    border-radius: var(--redwood-radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 18px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(199, 70, 52, 0.25);
}

.btn-redwood-primary:hover {
    background-color: var(--redwood-red-hover);
    border-color: var(--redwood-red-hover);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(199, 70, 52, 0.35);
}

.btn-redwood-primary:active {
    background-color: var(--redwood-red-active);
    border-color: var(--redwood-red-active);
}

.btn-redwood-secondary {
    background-color: var(--redwood-dark-base);
    color: #ffffff;
    border: 1px solid var(--redwood-dark-base);
    border-radius: var(--redwood-radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 18px;
    transition: all 0.15s ease;
}

.btn-redwood-secondary:hover {
    background-color: #2b2825;
    border-color: #2b2825;
    color: #ffffff;
}

.btn-redwood-outline {
    background-color: transparent;
    color: var(--redwood-text-primary);
    border: 1px solid var(--redwood-border-strong);
    border-radius: var(--redwood-radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 18px;
    transition: all 0.15s ease;
}

.btn-redwood-outline:hover {
    background-color: var(--redwood-surface-subtle);
    border-color: var(--redwood-text-secondary);
    color: var(--redwood-text-primary);
}

/* Form Controls */
.redwood-form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--redwood-text-secondary);
    margin-bottom: 5px;
    display: block;
}

.redwood-form-control {
    background-color: var(--redwood-surface);
    border: 1px solid var(--redwood-border-strong);
    border-radius: var(--redwood-radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--redwood-text-primary);
    transition: all 0.15s ease;
    width: 100%;
}

.redwood-form-control:focus {
    outline: none;
    border-color: var(--redwood-red);
    box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.15);
}

.redwood-form-control::placeholder {
    color: var(--redwood-text-muted);
}

/* ==========================================================================
   Input Groups & Form Controls Cohesion (Fixes Icon/Text Separation)
   ========================================================================== */

.input-group {
    position: relative;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
}

.input-group > .input-group-text {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    background-color: var(--redwood-surface) !important;
    border: 1px solid var(--redwood-border-strong);
    color: var(--redwood-text-secondary);
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.input-group > .redwood-form-control,
.input-group > .form-control,
.input-group > .form-select,
.input-group > input,
.input-group > select,
.input-group > textarea {
    position: relative !important;
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}

.input-group > .btn,
.input-group > .btn-redwood-primary,
.input-group > .btn-redwood-secondary,
.input-group > .btn-redwood-outline {
    position: relative;
    z-index: 2;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Rounded corners for input-group boundaries */
.input-group > :first-child {
    border-top-left-radius: var(--redwood-radius-sm) !important;
    border-bottom-left-radius: var(--redwood-radius-sm) !important;
}

.input-group > :last-child {
    border-top-right-radius: var(--redwood-radius-sm) !important;
    border-bottom-right-radius: var(--redwood-radius-sm) !important;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Border overrides inside input-group */
.input-group > .border-end-0 {
    border-right: 0 !important;
}

.input-group > .border-start-0 {
    border-left: 0 !important;
}

/* Seamless connection when icon has border-end-0 and input has border-start-0 */
.input-group > .input-group-text.border-end-0 + .border-start-0 {
    margin-left: 0 !important;
}

/* Unified focus effect when input inside group is focused */
.input-group:focus-within {
    border-radius: var(--redwood-radius-sm);
    box-shadow: 0 0 0 3px rgba(199, 70, 52, 0.15);
}

.input-group:focus-within > .input-group-text,
.input-group:focus-within > .redwood-form-control,
.input-group:focus-within > .form-control,
.input-group:focus-within > input,
.input-group:focus-within > select {
    border-color: var(--redwood-red) !important;
}

.input-group:focus-within > .redwood-form-control:focus,
.input-group:focus-within > .form-control:focus,
.input-group:focus-within > input:focus,
.input-group:focus-within > select:focus {
    box-shadow: none !important;
    z-index: 3 !important;
}

/* Small input group sizing */
.input-group-sm > .input-group-text,
.input-group-sm > .redwood-form-control,
.input-group-sm > .form-control,
.input-group-sm > .btn {
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
}

/* Button text and icon cohesion across all buttons */
.btn,
.btn-redwood-primary,
.btn-redwood-secondary,
.btn-redwood-outline {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    white-space: nowrap;
    vertical-align: middle;
}

.btn svg,
.btn-redwood-primary svg,
.btn-redwood-secondary svg,
.btn-redwood-outline svg {
    flex-shrink: 0 !important;
    vertical-align: middle;
}


/* ==========================================================================
   Redwood Modal Dialogs
   ========================================================================== */

.redwood-modal-backdrop {
    background-color: rgba(22, 21, 19, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 1055 !important;
}

.modal {
    z-index: 1055 !important;
}

.modal-dialog {
    pointer-events: auto !important;
    z-index: 1056 !important;
    max-width: 95vw;
    margin: 1.25rem auto;
}

.modal-dialog.modal-xl {
    max-width: min(1180px, 95vw);
}

.modal-dialog.modal-lg {
    max-width: min(880px, 95vw);
}

.modal-dialog.modal-md {
    max-width: min(580px, 95vw);
}

.redwood-modal-content,
.modal-content.redwood-modal-content {
    background-color: var(--redwood-surface) !important;
    border: 1px solid var(--redwood-border) !important;
    border-radius: var(--redwood-radius-lg) !important;
    box-shadow: var(--redwood-shadow-xl) !important;
    overflow: hidden;
    pointer-events: auto !important;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 2.5rem);
}

.redwood-modal-header {
    background-color: var(--redwood-surface-subtle);
    border-bottom: 1px solid var(--redwood-border);
    padding: 16px 22px;
    pointer-events: auto !important;
    flex-shrink: 0;
}

.redwood-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--redwood-text-primary);
    margin: 0;
}

.redwood-modal-footer {
    background-color: var(--redwood-surface-subtle);
    border-top: 1px solid var(--redwood-border);
    padding: 14px 22px;
    pointer-events: auto !important;
    flex-shrink: 0;
}

.modal-body,
.redwood-modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 170px);
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
}

/* ==========================================================================
   Oracle Fusion Redwood Login Screen
   ========================================================================== */

.redwood-login-backdrop {
    background: linear-gradient(135deg, #f7f6f4 0%, #edebe6 50%, #e8e4dc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.redwood-login-backdrop::before {
    content: "";
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 70, 52, 0.06) 0%, rgba(247, 246, 244, 0) 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.redwood-login-backdrop::after {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(49, 112, 143, 0.04) 0%, rgba(247, 246, 244, 0) 70%);
    bottom: -150px;
    left: -150px;
    pointer-events: none;
}

.redwood-login-card {
    background: #ffffff;
    border: 1px solid #e5e0d8;
    border-radius: 14px;
    box-shadow: 0 16px 40px -10px rgba(44, 40, 37, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.02);
    max-width: 440px;
    width: 100%;
    padding: 44px 38px;
    position: relative;
    z-index: 1;
}

.redwood-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.redwood-login-badge {
    width: 52px;
    height: 52px;
    background: #c74a2b;
    color: #ffffff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(199, 70, 52, 0.25);
}

/* ==========================================================================
   Responsive ERP & POS Utilities (Laptop, Edge & High-DPI Adaptation)
   ========================================================================== */

/* Prevent flex / grid column blowout across all cards & containers */
.redwood-card,
.row,
.col,
[class*="col-"] {
    min-width: 0;
}

/* Fluid responsive POS controls on laptops */
@media (max-width: 1400px) {
    .pos-top-bar {
        padding: 0.65rem 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .pos-top-bar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }
}

/* Table cell truncation helper for dense ERP grids */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}



/* Dashboard link pinned at top */
.redwood-dashboard-link {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3.5px solid var(--redwood-red, #c74634) !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    border-radius: 6px !important;
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.redwood-dashboard-link:hover {
    background: #fdf2f0 !important;
    border-color: #fecaca !important;
    color: var(--redwood-red, #c74634) !important;
}

.redwood-dashboard-link.active {
    background: var(--redwood-red, #c74634) !important;
    border-color: var(--redwood-red, #c74634) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(199, 70, 52, 0.25);
}

/* Compact Parent Section Heading Button (Light Sidebar ERP Theme) */
.redwood-nav-section-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 16px);
    margin: 2px 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 2.5px solid #94a3b8;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.redwood-nav-section-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    border-left-color: var(--redwood-red, #c74634);
    color: var(--redwood-red, #c74634);
}

.redwood-nav-section-btn.expanded {
    background: #fff8f6;
    border-color: #fecaca;
    border-left: 2.5px solid var(--redwood-red, #c74634);
    color: #991b1b;
    box-shadow: 0 1px 4px rgba(199, 70, 52, 0.06);
}

.redwood-nav-section-title-text {
    font-weight: 600;
    color: inherit;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.redwood-category-badge {
    background: #e2e8f0;
    color: #64748b;
    font-weight: 600;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.redwood-nav-section-btn.expanded .redwood-category-badge {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
}

.redwood-nav-chevron {
    font-size: 0.72rem;
    font-weight: bold;
    color: #94a3b8;
    transition: transform 0.15s ease, color 0.15s ease;
}

.redwood-nav-section-btn.expanded .redwood-nav-chevron {
    color: var(--redwood-red, #c74634);
}

.redwood-nav-submenu {
    display: flex;
    flex-direction: column;
    margin-left: 14px;
    margin-right: 8px;
    padding-left: 8px;
    border-left: 1.5px solid #fed7aa;
    margin-top: 2px;
    margin-bottom: 4px;
    animation: fadeInSubmenuAdmin 0.15s ease-in-out;
}

.redwood-nav-submenu .redwood-nav-link {
    color: #334155 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    padding: 5px 10px !important;
    margin: 1px 0 !important;
    border-radius: 5px !important;
}

.redwood-nav-submenu .redwood-nav-link:hover {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
}

.redwood-nav-submenu .redwood-nav-link.active {
    color: var(--redwood-red, #c74634) !important;
    background-color: #fdf2f0 !important;
    font-weight: 600 !important;
}

@keyframes fadeInSubmenuAdmin {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
