*, *::before, *::after { box-sizing: border-box; }

:root { --panel-bg: #ffffff; --text-main: #1e293b; --text-muted: #64748b; --border: #cbd5e1; }

body.theme-1 { --primary: #2e3192; --accent: #10b981; --accent-hover: #059669; --header-bg: #2e3192; --header-text: #ffffff; --bg: #f4f6f9; }
body.theme-2 { --primary: #4c1d95; --accent: #8b5cf6; --accent-hover: #7c3aed; --header-bg: #4c1d95; --header-text: #ffffff; --bg: #f5f3ff; } 
body.theme-3 { --primary: #800020; --accent: #dc2626; --accent-hover: #b91c1c; --header-bg: #800020; --header-text: #ffffff; --bg: #fdf2f8; } 
body.dark-mode { --bg: #0f172a; --panel-bg: #1e293b; --text-main: #f8fafc; --text-muted: #94a3b8; --border: #334155; --header-bg: #1e293b; --header-text: #f8fafc; --primary: #8b5cf6; }

body { font-family: 'Trebuchet MS', Arial, sans-serif; background-color: var(--bg); color: var(--text-main); margin: 0; padding: 0; display: flex; flex-direction: column; transition: background-color 0.3s ease, color 0.3s ease; height: 100vh; overflow: hidden; }
.main-wrapper { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.hidden { display: none !important; }

/* Buttons & Inputs */
.btn-main { width: 100%; padding: 15px; border-radius: 8px; border: none; background: var(--accent); color: white; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-main:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-2px); }
.btn-main:disabled { opacity: 0.8; cursor: not-allowed; }
.btn-yes { background: var(--accent); color: white; border: none; padding: 12px 25px; font-size: 15px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; margin: 5px; }
.btn-no { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 12px 25px; font-size: 15px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; margin: 5px; }
.btn-no:hover { background: #f1f5f9; color: #334155; }

.input-group { margin-bottom: 15px; text-align: left; position: relative; }
.input-group input, .input-group textarea, .input-group select { width: 100%; padding: 15px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.2); color: white; font-size: 15px; outline: none; transition: 0.3s; box-sizing: border-box; }
.input-group input:focus, .input-group textarea:focus { border-color: var(--accent); background: rgba(0,0,0,0.4); }
.input-group input[readonly] { background: rgba(0,0,0,0.4); cursor: not-allowed; border-color: rgba(255,255,255,0.1); }
.input-group input.input-error { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.error-msg { color: #fca5a5; font-size: 12px; margin-top: 5px; display: none; font-weight: 500;}
.security-mask { -webkit-text-security: disc; } 

/* Auth Views & Modals */
.auth-view { flex-grow: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--header-bg) 0%, #0f172a 35%, #0f172a 65%, var(--header-bg) 100%); overflow-y: auto; padding: 20px 0; transition: background 0.3s ease; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 9999; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); overflow-y: auto; padding: 20px 0;}
.auth-box { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; padding: 40px 50px; text-align: center; color: white; box-shadow: 0 15px 35px rgba(0,0,0,0.5); margin: auto; position: relative;}
.modal-box { background: var(--panel-bg); color: var(--text-main); width: 400px; max-width: 90%; border-radius: 12px; padding: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); border: 1px solid var(--border); text-align: center; position: relative; margin: auto;}
.modal-box input, .modal-box textarea, .modal-box select { color: var(--text-main); background: var(--bg); border: 1px solid var(--border); }
.modal-box input:focus, .modal-box textarea:focus { background: var(--panel-bg); }

/* Header & Navigation */
#appShell { display: flex; flex-direction: column; flex-grow: 1; height: 100%; }
.top-nav { background-color: var(--header-bg); color: var(--header-text); padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); flex-shrink: 0; transition: background-color 0.3s; z-index: 10;}
.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-controls { display: flex; gap: 8px; background: rgba(0,0,0,0.15); padding: 5px; border-radius: 8px; }
.nav-controls button { background: transparent; border: none; color: var(--header-text); cursor: pointer; padding: 6px; border-radius: 4px; display: flex; transition: 0.2s; }
.nav-controls button:hover { background: rgba(255,255,255,0.2); }
.nav-left h1 { margin: 0; font-size: 20px; font-weight: bold; border-left: 2px solid rgba(255,255,255,0.3); padding-left: 15px; }

.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: var(--panel-bg); min-width: 260px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); z-index: 100; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; top: 120%; left: 0;}
.dropdown-content a { color: var(--text-main); padding: 14px 18px; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--bg); transition: 0.2s; font-weight: bold;}
.dropdown-content a:hover { background-color: var(--bg); color: var(--primary);}
.show { display: block; }

.header-right { display: flex; align-items: center; gap: 20px; }
.network-status { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;}
.network-status.online { color: #10b981; filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5)); }
.network-status.offline { color: #ef4444; filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8)); }
.system-clock { font-size: 14px; font-weight: bold; background: rgba(0,0,0,0.15); padding: 8px 16px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); }
.toggle-group { display: flex; gap: 10px; border-right: 1px solid rgba(255,255,255,0.2); padding-right: 20px; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--header-text); padding: 6px; border-radius: 6px; cursor: pointer; display: flex; transition: 0.2s; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Dashboard Grid Layout (For Iframe Content) */
.workspace-area { flex-grow: 1; padding: 30px; display: flex; gap: 25px; align-items: stretch !important; position: relative; width: 100%; }

/* Footer */
.footer-wrapper { display: flex; justify-content: space-between; align-items: center; background-color: var(--header-bg); color: var(--header-text); padding: 15px 30px; box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05); flex-shrink: 0; transition: background-color 0.3s; z-index: 10; }
.footer-center { flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 15px;}
.ownership-text { font-family: 'Arial Black', Impact, sans-serif; font-size: 11px; letter-spacing: 0.5px; opacity: 0.8; margin: 0;}
.footer-logo { display: flex; align-items: center; justify-content: center; margin: 0; opacity: 0.9; transition: opacity 0.3s ease; }
.footer-logo:hover { opacity: 1; }
.footer-logo img { width: 95px; height: auto; object-fit: contain; }