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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

header nav {
    display: flex;
    gap: 10px;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

header nav a:hover,
header nav a.active {
    background: rgba(255,255,255,0.2);
}

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

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

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

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
}

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

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

.stat-card h3 {
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-detail {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 14px;
}

.stat-detail .online {
    color: #27ae60;
}

.stat-detail .offline {
    color: #e74c3c;
}

/* Tables */
.cmts-list, table {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cmts-list h3, h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #ecf0f1;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

tr:hover {
    background: #f8f9fa;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

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

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

button {
    padding: 10px 18px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #2980b9;
}

/* Button variants */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}
.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
}

.btn-outline {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}
.btn-outline:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Status labels */
.online {
    color: #27ae60;
    font-weight: 500;
}

.offline {
    color: #e74c3c;
    font-weight: 500;
}

/* Form enhancements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-actions button {
    width: auto;
    padding: 12px 24px;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: #95a5a6;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #7f8c8d;
    text-decoration: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.pagination a {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a:hover {
    background: #2980b9;
    text-decoration: none;
}

/* Filter form */
.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.filter-form button {
    width: auto;
    padding: 10px 20px;
}

/* Edit form */
.edit-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
}

/* Main content */
main {
    margin-top: 20px;
}

main h2 {
    margin-bottom: 20px;
}

/* OLT Section */
.olt-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.olt-section h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.olt-section h3 button {
    width: auto;
    padding: 6px 12px;
    font-size: 14px;
}

.olt-section h4 {
    margin: 15px 0 10px;
    color: #2c3e50;
}

#olt-status {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

#ont-table {
    margin-top: 10px;
}

/* OLT badge */
.olt-badge {
    display: inline-block;
    background: #9b59b6;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Warning status */
.warning {
    color: #f39c12;
    font-weight: 500;
}

/* Error text */
.error {
    color: #e74c3c;
}

/* GTP Change */
.gtp-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 180px;
}

.btn-gtp-change {
    padding: 6px 12px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 8px;
}

.btn-gtp-change:hover {
    background: #d35400;
}

.btn-gtp-change:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}
