/* --------------------------------------------------
   CORE LAYOUT — CLEAN REWRITE
-------------------------------------------------- */

/* GLOBAL BODY */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: transparent;
    overflow-x: hidden;
}

/* LANDING PAGE BACKGROUND */
body.landing {
    background: url('/assets/bg-blur.png') center/cover no-repeat fixed !important;
    display: flex;
    align-items: center;
    justify-content: center;
    //backdrop-filter: blur(2px);
}

/* DASHBOARD BACKGROUND */
body.dashboard {
    background: url('/assets/bg-blur.png') center/cover no-repeat fixed !important;
}

/* --------------------------------------------------
   NAVBAR (fixed, 60px height)
-------------------------------------------------- */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 60px;
    padding: 0.75rem 1rem;

    display: flex;
    align-items: center;
    flex-wrap: nowrap !important;

    background: rgb(12 11 11 / 50%);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);

    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);

    color: #fff;
    z-index: 1200;
}

/* Navbar title */
.glass-nav .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right-side user info */
.glass-nav .d-flex {
    flex-shrink: 0;
}

/* --------------------------------------------------
   BURGER BUTTON (inside navbar)
-------------------------------------------------- */
.mobile-burger-btn {
    display: none;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;

    padding: 6px 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-right: 12px;
}

/* --------------------------------------------------
   SIDEBAR (fixed, 240px)
-------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;

    width: 240px;
    height: calc(100vh - 60px);
    padding: 1.5rem 1rem;

    background: rgb(12 11 11 / 50%);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);

    border-right: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 4px 0 18px rgba(0,0,0,0.25);
    border-radius: 0 18px 18px 0;

    color: #fff;
    z-index: 500;
    overflow-y: auto;

    transform: translateX(0);
    transition: transform 0.3s ease;
}

/* Sidebar links */
.sidebar .nav-link {
    color: #fff;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
	margin-bottom: 1px;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.35);
    color: #000;
    font-weight: 600;
}

/* Sidebar links expanded*/
.sidebar .nav-link-expanded {
	margin-top: 4px;
}

/* --------------------------------------------------
   CONTENT WRAPPER (fluid layout)
-------------------------------------------------- */
.dashboard-bg,
.content-area,
.col-md-10 {
    margin-left: 240px;   /* sidebar width */
    margin-top: 60px;     /* navbar height */
    padding: 2rem;
    min-height: calc(100vh - 60px);
    color: #fff;
    box-sizing: border-box;
}

/* --------------------------------------------------
   SECTION 2 — COMPONENTS (Clean Rewrite)
-------------------------------------------------- */

/* --------------------------------------------------
   GLASS CARD (landing + dashboard)
-------------------------------------------------- */
.glass-card {
    background: rgb(12 11 11 / 50%);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    //transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

/* Landing page card width */
body.landing .glass-card {
    width: 480px;
    padding: 2.5rem;
    text-align: center;
}

/* --------------------------------------------------
   GLASS PANEL HEADER (dashboard)
-------------------------------------------------- */
.glass-panel {
    background: rgb(12 11 11 / 50%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    color: #fff;
    padding: 2rem;
}

/* --------------------------------------------------
   GLASS ACTION BUTTONS (dashboard + NC pages)
-------------------------------------------------- */
.glass-action {
    background: rgba(20, 20, 20, 0.15) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #151515 !important;

    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;

    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    background-clip: padding-box;
}

.glass-action:hover {
    //background: rgb(12 11 11 / 60%) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.glass-action:active {
    transform: translateY(0);
}

/* --------------------------------------------------
   GLASS TITLE
-------------------------------------------------- */
.text-muted {
    --bs-text-opacity: 1;
    color: #fff !important;
}

/* --------------------------------------------------
   COLOUR VARIANTS
-------------------------------------------------- */

/* BLUE — View, Upload */
.glass-blue {
    border-color: rgba(0, 170, 255, 0.8) !important;
    background: rgba(0, 170, 255, 0.55) !important;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
	color: #ffffff !important;
}
.glass-blue:hover {
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.8);
}

/* GREY — Edit, Show All */
.glass-grey {
    border-color: rgba(180, 180, 180, 0.7) !important;
    background: rgba(180, 180, 180, 0.35) !important;
    box-shadow: 0 0 8px rgba(180, 180, 180, 0.4);
	color: #fff !important;
}
.glass-grey:hover {
    box-shadow: 0 0 12px rgba(180, 180, 180, 0.7);
}

/* AMBER — Remedial */
.glass-amber {
    border-color: rgba(255, 200, 0, 0.8) !important;
    background: rgba(255, 200, 0, 0.35) !important;
    box-shadow: 0 0 8px rgba(255, 200, 0, 0.5);
	color: #151515 !important;
}
.glass-amber:hover {
    box-shadow: 0 0 12px rgba(255, 200, 0, 0.8);
}

/* GREEN — Change Status, Create NCN */
.glass-green {
    border-color: rgba(0, 127, 70, 0.8) !important;
    background: rgba(0, 255, 140, 0.65) !important;
    box-shadow: 0 0 8px rgba(0, 255, 140, 0.5);
	color: #151515 !important;
}
.glass-green:hover {
    box-shadow: 0 0 12px rgba(0, 255, 140, 0.8);
}

/* RED — Delete */
.glass-red {
    border-color: rgba(255, 60, 60, 0.9) !important;
    background: rgba(255, 60, 60, 0.35) !important;
    box-shadow: 0 0 8px rgba(255, 60, 60, 0.5);
	color: #151515  !important;
}
.glass-red:hover {
    box-shadow: 0 0 12px rgba(255, 60, 60, 0.8);
}

/* PURPLE — History */
.glass-purple {
    border-color: rgba(180, 80, 255, 0.8) !important;
    background: rgba(180, 80, 255, 0.35) !important;
    box-shadow: 0 0 8px rgba(180, 80, 255, 0.5);
	color: #151515 !important;
}
.glass-purple:hover {
    box-shadow: 0 0 12px rgba(180, 80, 255, 0.8);
}

/* ORANGE */
.glass-orange {
    border-color: rgba(255, 140, 0, 0.8) !important;
    background: rgba(255, 140, 0, 0.35) !important;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
	color: #151515 !important;
}
.glass-orange:hover {
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.8);
}

/* BRONZE */
.glass-bronze {
    border-color: rgba(205, 127, 50, 0.8) !important;
    background: rgba(205, 127, 50, 0.35) !important;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
	color: #151515 !important;
}
.glass-bronze:hover {
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.8);
}

/* PEACH */
.glass-peach {
    border-color: rgba(255, 180, 120, 0.8) !important;
    background: rgba(255, 180, 120, 0.35) !important;
    box-shadow: 0 0 8px rgba(255, 180, 120, 0.5);
	color: #151515 !important;
}
.glass-peach:hover {
    box-shadow: 0 0 12px rgba(255, 180, 120, 0.8);
}

/* MAGENTA */
.glass-magenta {
    border-color: rgba(255, 0, 200, 0.8) !important;
    background: rgba(255, 0, 200, 0.35) !important;
    box-shadow: 0 0 8px rgba(255, 0, 200, 0.5);
	color: #151515 !important;
}
.glass-magenta:hover {
    box-shadow: 0 0 12px rgba(255, 0, 200, 0.8);
}

/* DARK RED */
.glass-darkred {
    border-color: rgba(180, 0, 0, 0.9) !important;
    background: rgba(180, 0, 0, 0.35) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 0 8px rgba(180, 0, 0, 0.5);
	color: #151515  !important;
}
.glass-darkred:hover {
    box-shadow: 0 0 12px rgba(180, 0, 0, 0.9);
}

/* --------------------------------------------------
   SECTION 3 — PAGE LAYOUTS (Fluid Layout)
-------------------------------------------------- */

/* --------------------------------------------------
   DASHBOARD PAGE
-------------------------------------------------- */

.dashboard-bg {
   // backdrop-filter: blur(2px);
   // -webkit-backdrop-filter: blur(2px);
    border-radius: 16px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
    color: #fff;
}

/* Dashboard cards */
.dashboard-bg .glass-card {
    text-align: center;
    padding: 1.5rem;
}

/* Dashboard header panel */
.dashboard-bg .glass-panel {
    margin-bottom: 2rem;
    text-align: center;
}

/* --------------------------------------------------
   NC LIST PAGE (fluid layout)
-------------------------------------------------- */

body.nc-list-page {
    background: url('/assets/images/bakery-bg.jpg') center/cover no-repeat;
    position: relative;
    color: #f8f9fa;
}

body.nc-list-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

/* NC list content wrapper */
.nc-list-wrapper {
    position: relative;
    margin-left: 240px;   /* sidebar width */
    margin-top: 60px;     /* navbar height */
    padding: 2rem;
    z-index: 1;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
}

/* NC list headings */
.nc-list-wrapper h1,
.nc-list-wrapper h4 {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* NC list muted text */
.nc-list-wrapper p.text-muted {
    color: #ddd !important;
}

/* NC list buttons */
.nc-list-wrapper .btn {
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* --------------------------------------------------
   NC VIEW PAGE (fluid layout)
-------------------------------------------------- */

.nc-view-wrapper {
    position: relative;
    margin-left: 240px;
    margin-top: 60px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
    color: #fff;
}

/* Section divider */
.section-divider {
    border: 0;
    height: 8px;
    background: rgba(255,255,255,0.80);
    backdrop-filter: blur(4px);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* --------------------------------------------------
   NC CREATE PAGE (fluid layout)
-------------------------------------------------- */

.nc-create-wrapper {
    position: relative;
    margin-left: 240px;
    margin-top: 60px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
    color: #fff;
}

/* Form styling */
.nc-create-wrapper input,
.nc-create-wrapper select,
.nc-create-wrapper textarea {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem;
}

.nc-create-wrapper label {
    font-weight: 600;
    margin-bottom: 6px;
}

/* --------------------------------------------------
   TIMELINE (NC view)
-------------------------------------------------- */

.timeline {
    position: relative;
    padding-left: 50px;
    margin-top: 2rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
}

.timeline-marker {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
}

.timeline-item {
    margin-bottom: 2rem;
}

.timeline-item h4 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.timeline-item p {
    color: #ddd;
}

/* 1. Set the main table container properties */
table {
    width: 100%;
    border-collapse: separate; /* Crucial: Keeps borders from breaking the radius */
    border-spacing: 0;
    border-radius: 12px;       /* The overall corner curve radius */
    border: 2px solid #2d3748; /* Your dark slate border color */
}

/* 2. Fix the TOP CORNERS (Targeting the first and last header cell) */
table thead tr:first-child th:first-child {
    border-top-left-radius: 10px; /* Slightly smaller than outer border to look uniform */
}
table thead tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

/* 3. Fix the BOTTOM CORNERS (Targeting the first and last cell of the very last body row) */
table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}
table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

/* --------------------------------------------------
   SECTION 4 — UNIFIED MOBILE LAYER
-------------------------------------------------- */

@media (max-width: 768px) {

    /* NAVBAR */
    .glass-nav {
        width: 100% !important;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .glass-nav .navbar-brand {
        text-align: center;
        flex-grow: 1;
    }

    .mobile-burger-btn,
    #mobileMenu {
        display: inline-block !important;
        position: relative;
        z-index: 2100;
    }

    /* SIDEBAR */
    .sidebar {
        transform: translateX(-100%) !important;
        width: 240px !important;
        height: calc(100vh - 60px);
        top: 60px;
        z-index: 2000;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    /* CONTENT */
    .dashboard-bg,
    .content-area,
    .col-md-10,
    .nc-list-wrapper,
    .nc-view-wrapper,
    .nc-create-wrapper {
        margin-left: 0 !important;
        margin-top: 60px !important;
        padding: 1rem !important;
        width: 100% !important;
        position: relative !important;
    }

    /* ACTION BUTTONS */
    .glass-action {
        width: 100% !important;
        text-align: center;
        margin-bottom: 8px !important;
    }

    td a.glass-action {
        display: block !important;
        margin-bottom: 6px !important;
    }

    /* TABLE SCROLL WRAPPER */
    .table-scroll {
        overflow-x: auto !important;
        overflow-y: visible !important;
        position: relative !important;
    }

    /* TABLE FIX — ⭐ THIS IS THE IMPORTANT PART ⭐ */
    table {
        display: table !important;          /* removes clipping boundary */
        //width: max-content !important;      /* keeps horizontal scroll */
        white-space: nowrap !important;
        overflow: visible !important;       /* dropdown can escape */
    }

    table th,
    table td {
        padding: 6px !important;
        font-size: 0.85rem !important;
    }

    /* DROPDOWN FIX */
    .actions-cell {
        position: relative !important;
    }

    .actions-mobile .dropdown-menu {
        position: absolute !important;
        top: 100% !important;               /* sits directly under button */
        right: 0 !important;                /* flush right */

        width: max-content !important;
        min-width: 160px !important;
        max-width: 240px !important;

		min-width: unset !important;
        width: auto !important;
        max-width: 240px !important;

        z-index: 99999 !important;
        overflow-y: auto !important;
        max-height: 60vh !important;
    }
	
	.mobile-action-menu {
		background: #151515;
		border-radius: 8px;
		padding: 6px 0;
		max-height: 60vh;
		overflow-y: auto;
	}


    body.dashboard,
    body.nc-list-page {
        overflow-x: hidden !important;
    }
	
    /* Show ONLY: ID (1), Category (2), Column 3, Actions (last) */
    table th:nth-child(1),
    table td:nth-child(1),
    table th:nth-child(2),
    table td:nth-child(2),
    table th:nth-child(3),
    table td:nth-child(3),
    table th:last-child,
    table td:last-child {
        display: table-cell !important;
    }

		/* Hide all other columns */
		table th:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)):not(:last-child),
		table td:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)):not(:last-child) {
        display: none !important;
    }
	
	.mb-4 {
		margin-bottom: 0.8rem !important;
	}
	
	h1 {
		font-size: calc(0.8rem + 1.1vw) !important;
		
	}
	
	.text-muted {
		font-size: calc(0.5rem + 1.1vw) !important;
		margin-bottom: 0.4rem !important;
	}
}
