:root {
    --bg-main: #0f111a;
    --sidebar-bg: #1a1b26;
    --accent: #7aa2f7;
    --text-main: #a9b1d6;
    --danger: #f7768e;
    --card-bg: #1a1b26;
    --card-hover: #24283b;
    --border: #292e42;
}

body, html { margin: 0; padding: 0; height: 100%; font-family: 'Segoe UI', sans-serif; background: var(--bg-main); color: var(--text-main); overflow: hidden; }

/* Login */
#login-overlay { position: fixed; inset: 0; background: var(--bg-main); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.login-card { background: var(--sidebar-bg); padding: 40px; border-radius: 12px; border: 1px solid var(--border); text-align: center; width: 320px; }
input { width: 100%; padding: 12px; margin: 15px 0; border-radius: 6px; border: 1px solid #414868; background: #24283b; color: white; box-sizing: border-box; outline: none; }
.btn-login { width: 100%; padding: 12px; background: var(--accent); border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }

/* --- MAIN LAYOUT --- */
#app-wrapper { 
    display: flex; 
    height: 100vh; 
    width: 100vw; 
    overflow: hidden; 
}

#sidebar { 
    width: 260px; 
    min-width: 260px; 
    background: var(--sidebar-bg); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
}


#content-area { 
    flex: 1; /* Occupies all remaining space to the right */
    min-width: 0; /* CRITICAL: Prevents grid from breaking layout and forces icons into rows */
    position: relative; 
    display: flex; 
    flex-direction: column;
    overflow-y: auto; /* Allows scrolling only within the right-hand content section */
}

/* Sidebar Details */
.logo-area { padding: 25px 20px; font-weight: bold; color: var(--accent); border-bottom: 1px solid var(--border); letter-spacing: 2px; }
.nav-container { flex-grow: 1; padding: 15px; overflow-y: auto; }
.nav-item { padding: 12px 15px; cursor: pointer; border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; text-transform: uppercase; font-size: 0.85rem; transition: 0.2s; }
.nav-item:hover { background: var(--card-hover); color: var(--accent); }
.nav-item.active { background: var(--accent); color: var(--bg-main); font-weight: bold; }

/* CLOCKS */
.sidebar-clocks { padding: 25px 20px; border-top: 1px solid var(--border); background: #16161e; }
.clock-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 15px; }
.clock-item span:first-child { font-size: 0.65rem; color: #565f89; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
#cet-clock, #est-clock { font-size: 1.4rem; color: var(--accent); font-family: 'Courier New', monospace; font-weight: bold; text-shadow: 0 0 10px rgba(122, 162, 247, 0.2); }
.sidebar-footer { padding: 15px; font-size: 0.7rem; color: #414868; text-align: center; border-top: 1px solid rgba(41, 46, 66, 0.5); }

/* User Profile */
.user-profile { position: absolute; top: 20px; right: 40px; display: flex; align-items: center; gap: 10px; background: var(--sidebar-bg); padding: 8px 18px; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; z-index: 1500; }
.dropdown-content { display: none; position: absolute; top: 110%; right: 0; background: #1a1b26; min-width: 160px; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.show-dropdown { display: block !important; }

/* --- WELCOME SCREEN  --- */
.welcome-screen { 
    flex: 1; 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.welcome-container { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }
.main-logo { width: 220px; margin-bottom: 30px; }
.welcome-text h1 { font-size: 3rem; color: var(--accent); margin: 0; text-transform: uppercase; }

/* --- WORKSPACE GRID --- */
#workspace-view { width: 100%; display: flex; flex-direction: column; }
.workspace-header { padding: 40px 40px 10px; color: var(--accent); text-transform: uppercase; }
.search-container { padding: 0 40px 30px; position: relative; width: 100%; max-width: 500px; box-sizing: border-box; }
.search-input { width: 100%; padding: 12px 40px; background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: 8px; color: white; outline: none; }

.cards-grid { 
    display: grid !important; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; 
    gap: 25px; 
    padding: 0 40px 40px; 
    width: 100%; 
    box-sizing: border-box; 
}


/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); padding: 50px 20px; border-radius: 16px; text-align: center; cursor: pointer; transition: 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; position: relative; width: 100%; box-sizing: border-box;}
.card:hover { border-color: var(--accent); transform: translateY(-10px); background: var(--card-hover); }
.card-main-icon i { font-size: 3.5rem; display: block; }

/* Slide-out Panel */
#sublinks-panel { position: fixed; top: 0; right: -380px; width: 350px; height: 100vh; background: var(--sidebar-bg); border-left: 1px solid var(--border); transition: 0.4s ease-in-out; z-index: 2500; padding: 30px; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.5); }
#sublinks-panel.open { right: 0; }
.sublink-item { background: var(--card-hover); padding: 15px; border-radius: 8px; margin-bottom: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; color: white; }
.sublink-item:hover { border-color: var(--accent); transform: translateX(-5px); }