* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c9;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-links li a:hover,
.nav-links li.active a {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.875rem;
    color: #bdc3c9;
}

.content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #2c3e50;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-info {
    background: #16a085;
    color: #fff;
}

.btn-info:hover {
    background: #138d75;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table thead {
    background: #ecf0f1;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: #2c3e50;
}

.data-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    display: flex;
    gap: 5px;
}

.form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
    font-weight: 400;
}

.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover,
.pagination a.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.settings-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.settings-section h4 {
    margin: 20px 0 10px;
    color: #34495e;
}

.api-key-display {
    margin-top: 15px;
}

.api-key-value {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.api-key-value code {
    font-family: monospace;
    word-break: break-all;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.device-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.device-type {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    text-transform: capitalize;
}

.device-count {
    display: block;
    font-size: 1.5rem;
    color: #3498db;
    margin-top: 5px;
}

pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

.chart-section,
.analytics-section,
.top-links-section,
.device-stats {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-section h3,
.analytics-section h3,
.top-links-section h3,
.device-stats h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Tenant Users Section */
.tenant-users-section {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tenant-users-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.tenant-users-section h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.tenant-users-section hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}
