/**
 * @author Eugene Du Toit
 */

/* === UI ELEMENTS (must be at top — @import rules are ignored after any CSS rule) === */
@import url("uiElements/badge.css");
@import url("uiElements/breadcrumb.css");
@import url("uiElements/button.css");
@import url("uiElements/card.css");
@import url("uiElements/checkbox.css");
@import url("uiElements/divider.css");
@import url("uiElements/dropdown.css");
@import url("uiElements/input.css");
@import url("uiElements/loader.css");
@import url("uiElements/message.css");
@import url("uiElements/modal.css");
@import url("uiElements/notification.css");
@import url("uiElements/pagination.css");
@import url("uiElements/progress.css");
@import url("uiElements/radio.css");
@import url("uiElements/search.css");
@import url("uiElements/select.css");
@import url("uiElements/table.css");
@import url("uiElements/textarea.css");
@import url("uiElements/tooltip.css");
@import url("uiElements/upload.css");

/* === CUSTOMER CSS === */
@import url("../../../customer/css/customer.css");

/* ============================================================ */
/* DESIGN TOKENS — all rk- components reference these vars      */
/* ============================================================ */

:root {
  --rk-bg:           #111111;
  --rk-bg-surface:   #1a1a1a;
  --rk-bg-input:     #0d0d0d;
  --rk-border:       #2a2a2a;
  --rk-border-hover: #444444;
  --rk-accent:       #007BFF;
  --rk-accent-hover: #0056b3;
  --rk-accent-glow:  rgba(0, 123, 255, 0.35);
  --rk-text:         #ffffff;
  --rk-text-muted:   #888888;
  --rk-text-subtle:  #555555;
  --rk-radius:       6px;
  --rk-success:      #28a745;
  --rk-error:        #dc3545;
  --rk-warning:      #ffc107;
  --rk-info:         #17a2b8;
  /* font stack */
  --fd:              'Syne', sans-serif;
  --fb:              'Inter', sans-serif;
  --fm:              'DM Mono', monospace;
  /* footer aliases */
  --bd:              var(--rk-border);
  --sf:              var(--rk-bg-surface);
  --tx3:             var(--rk-text-subtle);
}

body.light-mode {
  --rk-bg:           #f0f0f0;
  --rk-bg-surface:   #ffffff;
  --rk-bg-input:     #ffffff;
  --rk-border:       #dddddd;
  --rk-border-hover: #aaaaaa;
  --rk-text:         #111111;
  --rk-text-muted:   #666666;
  --rk-text-subtle:  #999999;
}

/**************************************************************/
/* NAVBAR & NAVIGATION VIEW */
/**************************************************************/

*{
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000; /* Default dark background */
    font-family: 'Segoe UI', sans-serif;
    color: white;
    transition: background-color 0.3s, color 0.3s;
}

body.light-mode {
    background-color: #f5f5f5;
    color: #111;
}

.navView {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 99;
    height: 70px; /* Same as navbar height */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    background-color: #111;
    padding: 0 24px;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid var(--rk-accent);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body.light-mode .navbar {
    background-color: #ffffff;
    color: #111;
    /*border-bottom: 2px solid #ccc;*/
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px; /* spacing between profile icon and switch */
}

.nav-brand {
    font-family: var(--fd);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .2em;
    color: #DB8926;
    text-transform: uppercase;
    margin-left: 10px;
}

.nav-sep {
    margin: 0 8px;
    color: var(--rk-text-subtle);
    font-size: 14px;
}

.nav-crumb {
    font-family: var(--fd);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    color: var(--rk-text-muted);
    text-transform: uppercase;
}

.nav-theme-btn {
    background: transparent;
    border: 1px solid var(--rk-border);
    border-radius: var(--rk-radius);
    color: var(--rk-text-muted);
    font-size: 16px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, color .2s;
}

.nav-theme-btn:hover {
    border-color: var(--rk-accent);
    color: var(--rk-accent);
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--rk-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fd);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
}

/**************************************************************/
/* LIGHT/DARK TOGGLE SWITCH */
/**************************************************************/

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007BFF;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/**************************************************************/
/* MENU VIEW (INDEX VIEW) */
/**************************************************************/

.pageLayout {
    display: flex;
    height: calc(100vh - 70px);
    margin: 0;
    padding: 0;
}

/* Fixed container — handles positioning only */
.indexView {
    width: 20%;
    position: fixed;
    z-index: 98;
    left: 0;
    top: 70px;
    bottom: 36px;
    overflow-y: auto;
}

/* Inner view — Option 5 Glow Premium, bg from Option 3 */
.menuView {
    width: 100%;
    height: 100%;
    background: #111;
    border-right: 1px solid rgba(255,255,255,.04);
    display: flex;
    flex-direction: column;
    font-family: var(--fb);
    transition: background 0.3s;
}

.menuView::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--rk-accent) 0%, transparent 100%);
    flex-shrink: 0;
}

/* Brand block */
.menu-brand {
    padding: 20px 18px 0;
    margin-bottom: 24px;
}

.menu-brand-tag {
    font-family: var(--fm);
    font-size: 8px;
    color: #2a2a2a;
    letter-spacing: .22em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.menu-brand-name {
    font-family: var(--fd);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: .18em;
    color: var(--rk-text);
    text-transform: uppercase;
}

/* Nav list */
.menu-nav {
    flex: 1;
    padding: 16px 10px 0;
}

.menuList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menuList li {
    margin: 0;
}

/* Menu buttons — Syne, glow on active */
.menu-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--fd);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: transparent;
    color: #fff;
    transition: background .2s, color .2s, box-shadow .2s;
    text-align: left;
}

.menu-btn:hover {
    background: rgba(0,123,255,.06);
    color: var(--rk-accent);
}

.menu-btn.active {
    background: rgba(0,123,255,.06);
    color: var(--rk-accent);
}

/* Footer */
.menu-footer-actions {
    padding: 12px 10px 20px;
    border-top: 1px solid rgba(255,255,255,.04);
}

.menu-logout {
    color: #2a1010;
}

.menu-logout:hover {
    background: var(--rk-error) !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(220,53,69,.4) !important;
}

/* Light mode */
body.light-mode .menuView {
    background: #f5f5f5;
    border-right: 1px solid #ddd;
}

body.light-mode .menu-brand-name {
    color: #111;
}

body.light-mode .menu-btn {
    color: #aaa;
}

body.light-mode .menu-btn:hover {
    background: rgba(0,0,0,.04);
    color: #333;
}

body.light-mode .menu-logout {
    color: #ddd;
}

.menu-logout:hover {
    background-color: var(--rk-error) !important;
    color: white !important;
}

/**************************************************************/
/* MAIN CONTENT VIEW (MAINVIEW) */
/**************************************************************/

.mainView {
    position: fixed;
    top: 70px;
    left: 20%;
    right: 0;
    bottom: 36px;
    overflow-y: auto;
    z-index: 0;
    padding: 20px;
    background-color: #1a1a1a;
    color: white;
    transition: background-color 0.3s, color 0.3s;
}

body.light-mode .mainView {
    background-color: #ffffff;
    color: #111;
}

/* ============================================= */
/* === COLLAPSE LAYOUT WHEN VIEWS ARE HIDDEN === */
/* ============================================= */

/* When nav is hidden, mainView fills from the top */
#navView[display='Off'] ~ .pageLayout #mainView {
    top: 0;
}

/* When sidebar is hidden, mainView fills from the left */
#indexView[display='Off'] ~ #mainView {
    left: 0;
}

/* =========================== */
/* ==== LIGHT/DARK SUPPORT ==== */
/* =========================== */

body.light-mode {
  --card-bg: #ffffff;
  --text-color: #111;
  --input-bg: #f5f5f5;
}

body.dark-mode {
  --card-bg: #1a1a1a;
  --text-color: white;
  --input-bg: #111;
}

/* ======================= */
/* ===== MESSAGE VIEW ==== */
/* ======================= */

#messageView {
  position: fixed;
  top: 70px; /* just below navbar */
  left: 0;
  width: 100%;
  z-index: 10000;
  display: flex;
  justify-content: center;
  pointer-events: none; /* doesn't block clicks */
}

.message-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  max-width: 90%;
  pointer-events: none;
}

/* Individual messages */
.message-box {
  min-width: 250px;
  max-width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(-20px);
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  pointer-events: auto;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.6); /* Dark transparent base */
  color: white;
}

/* Light mode adaptation */
body.light-mode .message-box {
  background-color: rgba(255, 255, 255, 0.9);
  color: #111;
}

.message-box.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Close button */
.message-close {
  position: absolute;
  top: 6px;
  right: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.message-close:hover {
  opacity: 1;
}

/* Type indicators (colors apply to borders or icons if needed) */
.message-success {
  border-left: 4px solid #28a745;
}

.message-error {
  border-left: 4px solid #dc3545;
}

.message-warning {
  border-left: 4px solid #ffc107;
}

.message-info {
  border-left: 4px solid #17a2b8;
}

/* =========================== */
/* ===== DATA ATTRIBUTES ===== */
/* =========================== */

*[display='On']{
 display: inherit;
}

*[display='Off']{
 display: none;
}

/* ======================= */
/* ===== FOOTER ========== */
/* ======================= */

.app-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 97;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 16px;
  border-top: 1px solid var(--bd);
  background: var(--sf);
  opacity: .85;
}

.app-footer-powered {
  font-size: 9px;
  font-family: var(--fd);
  letter-spacing: .14em;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
}

.app-footer-logo {
  display: flex;
  align-items: center;
  line-height: 1;
  letter-spacing: .12em;
  color: #DB8926;
  text-transform: uppercase;
}

.app-footer-name {
  font-size: 11px;
  font-family: 'Syne', sans-serif;
  font-weight: 900;
  letter-spacing: .12em;
  color: #DB8926;
  text-transform: uppercase;
}

/* imports moved to top of file — @import must precede all CSS rules */



