:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --primary-darker: #075E54;
    --secondary: #34B7F1;
    --bg-light: #ece5dd;
    --bg-white: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --border: #dddddd;
    --danger: #dc3545;
    --success: #28a745;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body { background-color: var(--bg-light); color: var(--text-main); }
.hidden { display: none !important; }

#login-screen { height: 100vh; display: flex; align-items: center; justify-content: center; background-color: var(--primary-darker); }
.login-container { background: var(--bg-white); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 400px; }
.logo { text-align: center; margin-bottom: 30px; }
.logo h2 { color: var(--primary-dark); margin-top: 10px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: 500; color: var(--text-muted); }
.input-group input, .input-group select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 16px; }
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2); }

.btn-primary { background-color: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 4px; cursor: pointer; font-size: 16px; font-weight: 600; transition: background 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-danger { background-color: var(--danger); color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-success { background-color: var(--success); color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-text { background: none; border: none; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.w-100 { width: 100%; }
.error-msg { color: var(--danger); margin-top: 10px; text-align: center; font-size: 14px; }

#main-screen { display: flex; height: 100vh; }
.sidebar { width: 250px; background-color: var(--primary-darker); color: white; display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-nav { flex: 1; padding: 20px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 15px; padding: 15px 20px; color: rgba(255,255,255,0.8); text-decoration: none; transition: background 0.3s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background-color: var(--primary-dark); color: white; }
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.content { flex: 1; background-color: var(--bg-light); padding: 30px; overflow-y: auto; }
header { margin-bottom: 30px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.stat-card { background: var(--bg-white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.05); }
.stat-info h3 { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.stat-info p { font-size: 24px; font-weight: bold; color: var(--text-main); margin-top: 5px; }

.table-container { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background-color: #f8f9fa; font-weight: 600; color: var(--text-muted); }

.badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.success { background: #d4edda; color: #155724; }
.badge.danger { background: #f8d7da; color: #721c24; }
.badge.warning { background: #fff3cd; color: #856404; }
.badge.secondary { background: #e2e3e5; color: #383d41; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.status-dot.online { background-color: var(--success); }
.status-dot.offline { background-color: var(--text-muted); }

.tariffs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tariff-card { background: var(--bg-white); padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.tariff-card h3 { font-size: 20px; margin-bottom: 10px; }
.tariff-card .price { font-size: 24px; font-weight: bold; margin-bottom: 20px; color: var(--primary-dark); }
.tariff-card ul { list-style: none; margin-bottom: 20px; }
.tariff-card ul li { padding: 8px 0; border-bottom: 1px solid #eee; }

.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-white); border-radius: var(--radius); width: 100%; max-width: 500px; z-index: 1001; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; }

.renew-months-group { display: flex; gap: 8px; margin-top: 6px; }
.btn-month { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-white); cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn-month:hover { background: var(--bg-light); }
.btn-month.active { background: var(--primary); color: white; border-color: var(--primary); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; }
.toast { background: var(--primary-darker); color: white; padding: 15px 25px; border-radius: 4px; margin-top: 10px; box-shadow: var(--shadow); animation: slideIn 0.3s forwards; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
