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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h2 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 30px;
}

.login-card .icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 36px;
}

/* Sidebar */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    transition: all 0.3s;
    overflow-y: auto;
}

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

.sidebar-header h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #4fc3f7;
}

.sidebar-nav li a i {
    width: 25px;
    margin-right: 10px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 20px;
    min-height: 100vh;
}

.page-header {
    background: white;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.3s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.blue { border-left-color: #2196F3; }
.stat-card.green { border-left-color: #4CAF50; }
.stat-card.orange { border-left-color: #FF9800; }
.stat-card.red { border-left-color: #f44336; }
.stat-card.purple { border-left-color: #9C27B0; }
.stat-card.teal { border-left-color: #009688; }

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    float: right;
}

.stat-card .stat-icon.blue { background: linear-gradient(135deg, #2196F3, #1976D2); }
.stat-card .stat-icon.green { background: linear-gradient(135deg, #4CAF50, #388E3C); }
.stat-card .stat-icon.orange { background: linear-gradient(135deg, #FF9800, #F57C00); }
.stat-card .stat-icon.red { background: linear-gradient(135deg, #f44336, #D32F2F); }
.stat-card .stat-icon.purple { background: linear-gradient(135deg, #9C27B0, #7B1FA2); }
.stat-card .stat-icon.teal { background: linear-gradient(135deg, #009688, #00796B); }

.stat-card h3 {
    font-size: 28px;
    margin: 5px 0;
    color: #333;
}

.stat-card p {
    color: #888;
    margin: 0;
    font-size: 14px;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.content-card .card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
}

.content-card .card-body {
    padding: 20px;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

/* Status Badges */
.badge-online {
    background: #4CAF50;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-offline {
    background: #9E9E9E;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-active {
    background: #2196F3;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-inactive {
    background: #FF9800;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.photo-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-item .photo-info {
    padding: 10px;
    font-size: 12px;
    color: #666;
    background: white;
}

/* Map Container */
#map {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

/* Activation Code Display */
.activation-code {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 5px;
    color: #1e3c72;
    text-align: center;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 10px;
    border: 2px dashed #1e3c72;
    font-family: 'Courier New', monospace;
}

/* Child Detail */
.child-info-card {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

.child-info-card h2 {
    margin-bottom: 15px;
}

.child-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }
    .sidebar.active {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .stat-card h3 {
        font-size: 22px;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-card, .stat-card {
    animation: fadeIn 0.5s ease-out;
}

/* Form Styles */
.form-control:focus, .form-select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}