/* BlueGuard — Water & Fisheries Theme */
:root, [data-theme="light"] {
    --bg-primary: #006994;
    --bg-secondary: #00a8cc;
    --bg-light: #e0f4f7;
    --accent-teal: #008b9e;
    --accent-coral: #e07c5c;
    --text-dark: #0a3d4d;
    --wave-gradient: linear-gradient(135deg, #006994 0%, #00a8cc 50%, #008b9e 100%);
    --body-bg: #f0f8fa;
    --body-text: #333;
    --card-bg: #fff;
    --navbar-bg: #fff;
}

[data-theme="dark"] {
    --body-bg: #1a1f2e;
    --body-text: #e2e8f0;
    --card-bg: #252d3d;
    --navbar-bg: #252d3d;
    --bg-light: #2d3748;
}

body {
    background: var(--body-bg);
    color: var(--body-text);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Prototype notice — visible on all pages */
.prototype-banner {
    width: 100%;
    flex-shrink: 0;
    background: #F0F8FA;
    color: #1c1917;
    border-bottom: 2px solid #dc2626;
}
[data-theme="dark"] .prototype-banner {
    background: var(--body-bg);
    color: var(--body-text);
    border-bottom: 2px solid #dc2626;
}
.prototype-banner-link {
    color: #0a3d4d;
    font-weight: 600;
    text-decoration: underline;
}
.prototype-banner-link:hover {
    color: #062a35;
}
[data-theme="dark"] .prototype-banner-link {
    color: var(--body-text);
}
[data-theme="dark"] .prototype-banner-link:hover {
    color: #fff;
}

/* Sidebar */
.blueguard-sidebar {
    background: var(--wave-gradient);
    min-height: 100vh;
    box-shadow: 4px 0 12px rgba(0,105,148,.2);
}
.blueguard-sidebar .brand {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}
.blueguard-sidebar .brand small { opacity: .9; font-size: .75rem; font-weight: 400; }
.blueguard-sidebar .brand .brand-logo { max-height: 40px; max-width: 100%; margin-bottom: .5rem; display: block; }
.blueguard-sidebar .brand .brand-text { display: block; }
.blueguard-sidebar .nav-link {
    color: rgba(255,255,255,.9);
    border-radius: 8px;
    margin: 2px 8px;
    padding: .6rem .85rem;
}
.blueguard-sidebar .nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.blueguard-sidebar .nav-link.active { background: rgba(255,255,255,.25); color: #fff; }
.blueguard-sidebar .nav-link i { margin-right: 8px; width: 20px; text-align: center; }

/* Main content area */
.blueguard-content { background: var(--body-bg); }
.blueguard-navbar { background: var(--navbar-bg) !important; color: var(--body-text) !important; }
.blueguard-navbar .navbar-text { color: var(--body-text) !important; }
.blueguard-navbar .nav-link { color: var(--body-text) !important; }
[data-theme="dark"] .card { background: var(--card-bg); color: var(--body-text); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .card-header { background: var(--bg-light); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .table { color: var(--body-text); }
[data-theme="dark"] .dropdown-menu { background: var(--card-bg); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .dropdown-item { color: var(--body-text); }
[data-theme="dark"] .dropdown-item:hover { background: var(--bg-light); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background: var(--card-bg); color: var(--body-text); border-color: rgba(255,255,255,.2); }

/* Cards */
.card.blueguard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,105,148,.08);
    border-left: 4px solid var(--bg-secondary);
}
.card.blueguard-card .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid rgba(0,168,204,.15);
    font-weight: 600;
    color: var(--text-dark);
}

/* Buttons */
.btn-primary { background: var(--bg-primary); border-color: var(--bg-primary); }
.btn-primary:hover { background: var(--bg-secondary); border-color: var(--bg-secondary); }
.btn-outline-primary { color: var(--bg-primary); border-color: var(--bg-primary); }
.btn-outline-primary:hover { background: var(--bg-primary); color: #fff; }

/* Login — split layout: image left, form right */
.login-page { margin: 0; min-height: 100vh; }
.login-page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.login-split {
    display: flex;
    flex: 1;
    min-height: 0;
}
.login-split-image {
    flex: 1;
    min-width: 0;
    position: relative;
    display: none;
}
@media (min-width: 768px) {
    .login-split-image { display: block; }
}
.login-split-image-inner {
    position: absolute;
    inset: 0;
    background: var(--wave-gradient);
    /* Lake Victoria, Entebbe, Uganda - Russell Lindberg, CC BY-SA 3.0, via Wikimedia Commons */
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/c/c6/Lake_Victoria%2C_Entebbe%2C_Uganda_-_panoramio.jpg');
    background-size: cover;
    background-position: center;
}
.login-split-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,105,148,.75) 0%, rgba(0,168,204,.6) 50%, rgba(0,139,158,.7) 100%);
}
.login-split-brand {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
    text-align: center;
}
.login-split-logo { font-size: 4rem; margin-bottom: .5rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,.2)); }
.login-split-brand h2 { font-size: 2rem; font-weight: 700; margin: 0 0 .5rem; text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.login-split-brand p { font-size: 1rem; opacity: .95; margin: 0; }

.login-split-form {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}
@media (min-width: 768px) {
    .login-split-form { flex: 0 0 440px; }
}
.login-form-card {
    width: 100%;
    max-width: 380px;
}
.login-form-title { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); margin-bottom: .25rem; }
.login-form-subtitle { color: #6b7280; font-size: .95rem; margin-bottom: 1.75rem; }
.login-form .form-control-lg { padding: .65rem 1rem; border-radius: 10px; }
.login-form .btn-primary { padding: .65rem 1.25rem; border-radius: 10px; }
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: #9ca3af;
    font-size: .875rem;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.login-divider span { padding: 0 1rem; }

/* Shared footer — login and main app */
.app-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem 1.5rem;
    padding: .75rem 1.5rem;
    font-size: .8125rem;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.app-footer-copy { font-weight: 500; color: #374151; }
.app-footer-powered a {
    color: var(--bg-primary);
    text-decoration: none;
}
.app-footer-powered a:hover { text-decoration: underline; }

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: .65rem 1.25rem;
    font-size: 1rem;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #3c4043;
    transition: background .2s, box-shadow .2s;
}
.btn-google:hover { background: #f8f9fa; color: #3c4043; border-color: #dadce0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.login-form-hint { font-size: .8rem; }
.demo-login-list li { margin-bottom: .35rem; }
.demo-login-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.demo-login-btn:hover { color: var(--bg-primary); text-decoration: underline; }

/* Dashboard */
.dashboard-stat {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
    background: var(--wave-gradient);
}
.dashboard-stat.alt { background: linear-gradient(135deg, #008b9e 0%, #00a8cc 100%); }
.dashboard-stat .stat-value { font-size: 1.75rem; font-weight: 700; }
.dashboard-stat .stat-label { opacity: .9; font-size: .9rem; }

/* Alerts */
.alert-warning { border-left: 4px solid var(--accent-coral); }
.table thead th { color: var(--text-dark); border-bottom: 2px solid var(--bg-secondary); }

/* Navbar (top) */
.navbar-blueguard { background: var(--wave-gradient) !important; box-shadow: 0 2px 8px rgba(0,105,148,.2); }
.navbar-blueguard .navbar-brand, .navbar-blueguard .nav-link { color: #fff !important; }
.navbar-blueguard .nav-link:hover { color: rgba(255,255,255,.9) !important; }

/* Sidebar submenu */
.sidebar-toggle { cursor: pointer; }
.nav-link.active { font-weight: 600; }
.nav-item-with-submenu .nav-link { font-weight: 500; }
.nav-item-with-submenu .submenu-indicator {
    float: right;
    opacity: .9;
    font-size: .8em;
    font-weight: 600;
}
.nav-item-with-submenu .sidebar-toggle[aria-expanded="true"] .submenu-indicator { transform: rotate(90deg); display: inline-block; }

/* Role assignments */
.assignment-card {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,105,148,.06);
    border: 1px solid rgba(0,105,148,.1);
    transition: box-shadow .2s, transform .15s;
}
.assignment-card:hover {
    box-shadow: 0 4px 20px rgba(0,105,148,.12);
}
.assignment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--wave-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.assignment-roles .badge { font-weight: 500; }
.assignments-pagination { margin-top: 1.5rem; }

/* Manage roles */
.manage-roles-card .card-header { background: linear-gradient(135deg, rgba(0,105,148,.08) 0%, rgba(0,168,204,.06) 100%); }
.manage-roles-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--wave-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}
.role-checkboxes { display: flex; flex-direction: column; gap: .5rem; }
.role-checkbox-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    border-radius: 8px;
    background: var(--body-bg);
    border: 1px solid rgba(0,105,148,.12);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.role-checkbox-item:hover { background: rgba(0,105,148,.04); }
.role-checkbox-input { width: 1.1rem; height: 1.1rem; accent-color: var(--bg-primary); cursor: pointer; }
.role-checkbox-custom { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.role-checkbox-custom .role-badge { font-weight: 500; }
.role-desc { font-size: .9rem; }

/* Roles index */
.role-card .card-header { background: linear-gradient(135deg, rgba(0,105,148,.06) 0%, rgba(0,168,204,.04) 100%); }
.role-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
}
.role-permissions .badge { font-weight: 500; }

/* Settings dashboard */
.settings-dashboard .nav-tabs .nav-link { color: var(--body-text); border-color: transparent; }
.settings-dashboard .nav-tabs .nav-link:hover { border-color: rgba(0,105,148,.2); }
.settings-dashboard .nav-tabs .nav-link.active { color: var(--bg-primary); border-bottom-color: var(--bg-primary); font-weight: 600; }
.settings-dashboard .form-control-color { width: 3rem; height: 2.5rem; padding: .2rem; cursor: pointer; }
.settings-dashboard .color-picker-group .form-control { flex: 1; }
.settings-dashboard .settings-preview { border-radius: 8px; }
