:root {
    --primary: #25D366;
    --secondary: #075E54;
    --dark: #128C7E;
    --light: #f4f7f6;
    --white: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 25px;
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    background: var(--light);
    margin: 0;
    padding: 0;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    transition: 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.2);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 14px;
}

/* Sidebar Professional & Scrollable */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--secondary);
    position: fixed;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: 0.3s;
    z-index: 1000;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: 0.3s;
    background: #f8fafc;
}

.nav-links {
    list-style: none;
    padding: 15px;
    margin: 0;
}

.nav-links li {
    margin-bottom: 5px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    transition: 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    font-weight: 700;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    margin-left: 10px;
    transition: 0.3s;
}

.copy-btn:hover {
    background: var(--dark);
    transform: scale(1.05);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 9999;
}

/* Login Page */
.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 350px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .sidebar {
        left: -260px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content,
    .top-header {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .top-header {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .status-left span:first-child {
        display: none;
        /* Hide device name on small mobile */
    }

    .card-status {
        padding: 20px;
    }

    .battery-info {
        padding: 5px 8px;
        font-size: 12px;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.card-status {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    text-align: left;
    padding: 15px;
    background: #f8f9fa;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

td {
    padding: 15px;
    border-bottom: 1px solid #efefef;
    font-size: 14px;
}

/* Badge status */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* Top Header Styling */
.top-header {
    height: 70px;
    background: var(--white);
    margin-left: 260px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: 0.3s;
}

/* Hamburgir menu for mobile */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse {
    width: 10px;
    height: 10px;
    background: #888;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1s infinite;
}

.pulse-green {
    width: 10px;
    height: 10px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #25D366;
    animation: blink 1.5s infinite;
}

.pulse-red {
    width: 10px;
    height: 10px;
    background: #ff7675;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #ff7675;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.battery-info {
    font-weight: bold;
    color: #444;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 10px;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Quick Reply Modal/Dropdown */
.quick-reply-btn {
    background: #eee;
    border: none;
    padding: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

.quick-reply-btn:hover {
    background: #ddd;
}

#templateModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.tpl-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
}

.tpl-item:hover {
    background: #f0f0f0;
    border-radius: 10px;
}