* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef2f7;
    color: #1f2937;
}

a {
    text-decoration: none;
}

.admin-app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #07152e 0%, #0b1f47 100%);
    color: #fff;
    padding: 22px 18px;
    flex-shrink: 0;
}

.brand {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    color: #ff3b3b;
    margin-bottom: 18px;
}

.brand-sub {
    color: #d7def0;
    font-size: 14px;
    margin-bottom: 18px;
}

.user-box {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 24px;
}

.user-box .label {
    font-size: 13px;
    color: #c8d2e8;
    margin-bottom: 5px;
}

.user-box .value {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.role-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dff7e5;
    color: #146c2e;
    font-size: 12px;
    font-weight: 700;
}

.menu-group {
    margin-bottom: 24px;
}

.menu-title {
    font-size: 12px;
    letter-spacing: 2px;
    color: #95a7cc;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    margin-bottom: 8px;
}

.menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 14px;
    border-radius: 14px;
    color: #f8fbff;
    background: transparent;
    transition: all 0.2s ease;
    font-weight: 700;
}

.menu a:hover {
    background: rgba(255,255,255,0.08);
}

.menu a.active {
    background: rgba(255,255,255,0.14);
}

.menu small {
    color: #bfcbe2;
    font-size: 12px;
    font-weight: 600;
}

.main {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    color: #0f172a;
}

.page-subtitle {
    margin-top: 8px;
    color: #64748b;
    font-size: 15px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: #fff;
}

.btn-primary {
    background: #23415f;
}

.btn-primary:hover {
    background: #1d3650;
}

.btn-success {
    background: #0f8b8d;
}

.btn-success:hover {
    background: #0d7475;
}

.btn-danger {
    background: #c92f3c;
}

.btn-danger:hover {
    background: #a92530;
}

.btn-purple {
    background: #7c3aed;
}

.btn-purple:hover {
    background: #6b30cf;
}

.card {
    background: #ffffff;
    border: 1px solid #dce5f1;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    margin-bottom: 22px;
}

.card-title {
    margin: 0 0 14px 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: #fff;
    border: 1px solid #dce5f1;
    border-radius: 18px;
    padding: 18px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
}

.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: #4f7cac;
    box-shadow: 0 0 0 3px rgba(79, 124, 172, 0.12);
}

.search-input {
    flex: 1;
    min-width: 240px;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table th,
.table td {
    border-bottom: 1px solid #e5ebf3;
    padding: 14px 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.table td {
    color: #0f172a;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #274c77;
    font-size: 12px;
    font-weight: 700;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-success {
    background: #e7f8ec;
    color: #146c2e;
    border: 1px solid #bde6c7;
}

.alert-error {
    background: #fdecec;
    color: #a11d2f;
    border: 1px solid #f5c2c7;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #334155;
}

.footer-note {
    color: #64748b;
    font-size: 13px;
    margin-top: 20px;
}

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 230px;
    }
}

@media (max-width: 800px) {
    .admin-app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main {
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* ===== DATABASE MANAGER FIX ===== */

.menu a{
    color:#1e293b;
}

.menu a small{
    color:#64748b;
}

.menu a:hover{
    background:#e8f1ff;
}

.menu a.active{
    background:#2563eb;
    color:#fff;
}

.menu a.active small{
    color:#cfe1ff;
}

/* table fix */

.table{
    color:#0f172a;
}

.table th{
    color:#1e293b;
}

.table td{
    color:#0f172a;
}

/* database tables sidebar */

.menu li{
    margin-bottom:6px;
}

.menu a{
    display:flex;
    justify-content:space-between;
    padding:10px 12px;
    border-radius:8px;
    text-decoration:none;
}
}

/* device monitor helper */
.badge-online {
    background: #e7f8ec;
    color: #146c2e;
}

.badge-offline {
    background: #fdecec;
    color: #a11d2f;
}

/* device monitor helper */
.badge-online {
    background: #e7f8ec;
    color: #146c2e;
}

.badge-offline {
    background: #fdecec;
    color: #a11d2f;
}