* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    background: #f4f7fb;
}

.login-body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0B5394, #073763);
}

.login-box {
    width: 380px;
    background: #ffffff;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.login-box h2 {
    text-align: center;
    color: #0B5394;
    margin-bottom: 5px;
}

.login-box p {
    text-align: center;
    color: #555;
    margin-bottom: 25px;
}

.login-box label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
    color: #333;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.login-box button {
    width: 100%;
    padding: 13px;
    background: #0B5394;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.login-box button:hover {
    background: #073763;
}

.error {
    background: #ffe5e5;
    color: #b30000;
    padding: 10px;
    border-radius: 7px;
    margin-bottom: 15px;
    text-align: center;
}

.sidebar{
    position:fixed;
    left:0;
    top:0;
    width:240px;
    height:100%;
    background:#0B5394;
    padding-top:20px;
}

.sidebar h2{
    color:white;
    text-align:center;
    margin-bottom:30px;
}

.sidebar a{
    display:block;
    color:white;
    padding:15px 25px;
    text-decoration:none;
    transition:0.3s;
}

.sidebar a:hover{
    background:#073763;
}

.main-content input,
.main-content select,
.main-content textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0 18px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.main-content textarea {
    min-height: 80px;
}

.main-content button {
    background: #0B5394;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.main-content button:hover {
    background: #073763;
}

.main-content table {
    border-collapse: collapse;
    background: white;
}

.main-content th {
    background: #0B5394;
    color: white;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
}

.dashboard-card{
    background:white;
    padding:25px;
    border-radius:14px;
    box-shadow:0 3px 12px rgba(0,0,0,0.08);
}

.dashboard-card h2{
    margin:0;
    color:#0B5394;
    font-size:32px;
}

.dashboard-card p{
    margin-top:10px;
    color:#666;
}

/* =========================
   TRICONNECT PROFESSIONAL UI
========================= */

:root {
    --primary: #0B5394;
    --primary-dark: #073763;
    --secondary: #0f172a;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

body {
    background: var(--bg);
    color: var(--text);
}

.app-wrapper {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #0B5394, #073763);
    padding: 22px 16px;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-logo {
    color: white;
    margin-bottom: 30px;
    padding: 10px 12px;
}

.sidebar-logo h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.sidebar-logo span {
    font-size: 13px;
    opacity: 0.8;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #eaf3ff;
    padding: 14px 16px;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 15px;
    transition: 0.3s ease;
}

.sidebar a i {
    width: 20px;
    text-align: center;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.16);
    color: white;
    transform: translateX(3px);
}

.sidebar-bottom {
    margin-top: 35px;
}

.main-content {
    margin-left: 260px;
    padding: 28px;
}

.topbar {
    background: white;
    padding: 22px 26px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.06);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.topbar h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: var(--secondary);
}

.topbar p {
    margin: 0;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}

.dashboard-card {
    background: white;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.06);
    border: 1px solid var(--border);
    transition: 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(15,23,42,0.10);
}

.dashboard-card h2 {
    margin: 0;
    color: var(--primary);
    font-size: 30px;
}

.dashboard-card p {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 500;
}

/* Forms */
.main-content form {
    max-width: 100%;
}

.main-content label {
    font-weight: 600;
    color: #374151;
}

.main-content input,
.main-content select,
.main-content textarea {
    width: 100%;
    padding: 13px 14px;
    margin: 8px 0 18px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #fff;
}

.main-content input:focus,
.main-content select:focus,
.main-content textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11,83,148,0.12);
}

.main-content button {
    background: var(--primary);
    color: white;
    padding: 13px 22px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
}

.main-content button:hover {
    background: var(--primary-dark);
}

/* Tables */
.main-content table {
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.main-content th {
    background: var(--primary);
    color: white;
}

.main-content td,
.main-content th {
    border: 1px solid var(--border);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-radius: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 18px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 24px;
    }
}

/* =========================
   FIXED TOP NAVBAR - TRICONNECT
========================= */

.top-navbar {
    width: 100%;
    min-height: 82px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 16px 24px;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px;
}

.top-navbar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-navbar-left h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.top-navbar-left span {
    font-size: 13px;
    color: #6b7280;
}

.top-navbar-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 16px;
}

.top-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #f3f6fb;
    color: #0B5394;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.user-profile {
    display: flex !important;
    align-items: center !important;
    gap: 12px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 8px 14px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: #0B5394;
    color: #ffffff;
    font-weight: 700;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.user-info {
    display: flex !important;
    flex-direction: column;
    line-height: 1.3;
}

.user-info strong {
    font-size: 14px;
    color: #0f172a;
}

.user-info span {
    font-size: 12px;
    color: #6b7280;
}

/* Mobile */
@media (max-width: 768px) {
    .top-navbar {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 16px;
    }

    .top-navbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .user-profile {
        flex: 1;
    }
}

/* =========================
   DARK MODE
========================= */

.dark-toggle{
    width:44px;
    height:44px;
    border:none;
    border-radius:14px;
    background:#f3f6fb;
    color:#0B5394;
    cursor:pointer;
    font-size:16px;

    display:flex;
    align-items:center;
    justify-content:center;
}

/* DARK BODY */

body.dark-mode{
    background:#0f172a;
    color:#f1f5f9;
}

/* Main Content */

body.dark-mode .main-content{
    background:#0f172a;
}

/* Cards */

body.dark-mode .dashboard-card,
body.dark-mode .topbar,
body.dark-mode .top-navbar,
body.dark-mode .main-content table,
body.dark-mode .user-profile{
    background:#1e293b;
    color:#f1f5f9;
    border-color:#334155;
}

/* Text */

body.dark-mode .top-navbar-left h3,
body.dark-mode .dashboard-card h2,
body.dark-mode .user-info strong,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3{
    color:#ffffff;
}

body.dark-mode p,
body.dark-mode span,
body.dark-mode td,
body.dark-mode th,
body.dark-mode label{
    color:#cbd5e1;
}

/* Inputs */

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea{
    background:#0f172a;
    color:white;
    border:1px solid #334155;
}

/* Tables */

body.dark-mode th{
    background:#0B5394;
}

body.dark-mode td{
    background:#1e293b;
}

/* Toggle */

body.dark-mode .dark-toggle{
    background:#334155;
    color:#ffffff;
}

.charts-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:22px;
    margin-top:20px;
}

.chart-card{
    background:white;
    padding:25px;
    border-radius:18px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    border:1px solid #e5e7eb;
}

.chart-card h2{
    margin-top:0;
    margin-bottom:20px;
}

body.dark-mode .chart-card{
    background:#1e293b;
    border-color:#334155;
    color:white;
}

@media(max-width:768px){
    .charts-grid{
        grid-template-columns:1fr;
    }
}

/* =========================
   NOTIFICATIONS
========================= */

.notification-wrapper{
    position:relative;
}

.notification-badge{
    position:absolute;
    top:-6px;
    right:-6px;
    background:#ef4444;
    color:white;
    font-size:11px;
    min-width:20px;
    height:20px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    border:2px solid white;
}

.notification-dropdown{
    position:absolute;
    top:56px;
    right:0;
    width:290px;
    background:white;
    border:1px solid #e5e7eb;
    border-radius:16px;
    box-shadow:0 12px 30px rgba(15,23,42,0.12);
    padding:15px;
    display:none;
    z-index:2000;
}

.notification-dropdown.show{
    display:block;
}

.notification-dropdown h4{
    margin:0 0 12px 0;
    color:#0f172a;
}

.notification-dropdown a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px;
    border-radius:12px;
    text-decoration:none;
    color:#374151;
    font-size:14px;
}

.notification-dropdown a:hover{
    background:#f3f6fb;
}

.notification-dropdown a i{
    color:#0B5394;
}

body.dark-mode .notification-dropdown{
    background:#1e293b;
    border-color:#334155;
}

body.dark-mode .notification-dropdown h4,
body.dark-mode .notification-dropdown a{
    color:#f1f5f9;
}

body.dark-mode .notification-dropdown a:hover{
    background:#334155;
}

/* =========================
   SIDEBAR SECTION TITLES
========================= */

.sidebar-section-title{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#94a3b8;
    margin:22px 18px 10px;
    font-weight:700;
}

body.dark-mode .sidebar-section-title{
    color:#64748b;
}

/* =========================
   COMMUNICATION CENTER
========================= */

.chat-layout{
    display:grid;
    grid-template-columns:1fr 1.3fr;
    gap:22px;
}

.chat-card{
    background:white;
    padding:25px;
    border-radius:18px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    border:1px solid #e5e7eb;
}

.message-item{
    background:#f8fafc;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:15px;
    margin-bottom:14px;
}

.message-top{
    display:flex;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
}

.message-top span{
    font-size:12px;
    color:#6b7280;
}

.message-item p{
    margin:8px 0;
    color:#374151;
}

.message-item small{
    color:#6b7280;
}

body.dark-mode .chat-card,
body.dark-mode .message-item{
    background:#1e293b;
    border-color:#334155;
}

body.dark-mode .message-item p,
body.dark-mode .message-item small{
    color:#cbd5e1;
}

@media(max-width:768px){
    .chat-layout{
        grid-template-columns:1fr;
    }
}

.conversation-box{
    border:1px solid #e5e7eb;
    border-radius:18px;
    margin-bottom:20px;
    overflow:hidden;
}

.conversation-header{
    background:#f8fafc;
    padding:15px 18px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
}

.conversation-thread{
    padding:18px;
    max-height:420px;
    overflow-y:auto;
}

.thread-message{
    padding:14px;
    border-radius:14px;
    margin-bottom:14px;
}

.my-message{
    background:#e0f2fe;
}

.other-message{
    background:#f1f5f9;
}

.thread-top{
    display:flex;
    justify-content:space-between;
    margin-bottom:8px;
}

.thread-top small{
    color:#64748b;
}

.reply-form{
    border-top:1px solid #e5e7eb;
    padding:18px;
}

.reply-form textarea{
    min-height:90px;
}

body.dark-mode .conversation-box,
body.dark-mode .thread-message{
    background:#1e293b;
    border-color:#334155;
}

body.dark-mode .conversation-header{
    background:#0f172a;
}

body.dark-mode .my-message{
    background:#0B5394;
}

body.dark-mode .other-message{
    background:#334155;
}
/* =========================
   TENANT PROFILE VIEW
========================= */

.profile-actions{
    display:flex;
    gap:12px;
    margin-bottom:22px;
    flex-wrap:wrap;
}

.btn-primary,
.btn-secondary,
.btn-danger{
    padding:12px 18px;
    border-radius:12px;
    text-decoration:none;
    font-weight:700;
    display:inline-block;
}

.btn-primary{
    background:#0B5394;
    color:white;
}

.btn-secondary{
    background:#e5e7eb;
    color:#111827;
}

.btn-danger{
    background:#dc2626;
    color:white;
}

.tenant-profile-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:22px;
    margin-bottom:22px;
}

.profile-card{
    background:white;
    padding:25px;
    border-radius:18px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
    border:1px solid #e5e7eb;
}

.profile-main{
    text-align:center;
}

.tenant-avatar{
    width:85px;
    height:85px;
    border-radius:50%;
    background:#0B5394;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:36px;
    font-weight:800;
    margin:0 auto 15px;
}

.status-badge{
    display:inline-block;
    padding:8px 14px;
    background:#dcfce7;
    color:#166534;
    border-radius:999px;
    font-weight:700;
}

.full-width{
    margin-bottom:22px;
}

body.dark-mode .profile-card{
    background:#1e293b;
    border-color:#334155;
}

body.dark-mode .btn-secondary{
    background:#334155;
    color:#f8fafc;
}

/* ================================
   MODERN TENANT SIDEBAR
================================ */

.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    padding: 24px 18px;
    z-index: 999;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
}

.sidebar-brand {
    text-align: center;
    margin-bottom: 35px;
}

.brand-logo {
    width: 75px;
    height: 75px;
    margin: auto;
    border-radius: 22px;
    background: linear-gradient(135deg,#3b82f6,#06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(59,130,246,0.35);
}

.sidebar-brand h2 {
    color: white;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.sidebar-brand p {
    color: #94a3b8;
    margin-top: 6px;
    font-size: 14px;
}

.sidebar-category {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 28px 10px 12px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.03);
}

.sidebar-menu a span {
    font-size: 20px;
}

.sidebar-menu a:hover {
    transform: translateX(6px);
    background: linear-gradient(135deg,#3b82f6,#06b6d4);
    color: white;
    box-shadow: 0 8px 18px rgba(59,130,246,0.30);
}

.logout-link:hover {
    background: linear-gradient(135deg,#ef4444,#f97316) !important;
}

.main-content {
    margin-left: 300px;
    padding: 30px;
}

/* Dashboard Cards */
.main-content .topbar,
.main-content .card,
.main-content table,
.main-content form,
.main-content .chat-card,
.main-content .conversation-box {
    border-radius: 18px;
}

/* Responsive */
@media(max-width: 900px){

    .sidebar{
        width:100%;
        height:auto;
        position:relative;
    }

    .main-content{
        margin-left:0;
    }

}