* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
header {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.header-left { display: flex; flex-direction: column; justify-content: center; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h1 { color: #00d4ff; font-size: 1.8em; }
h2 { color: #00d4ff; margin-bottom: 15px; font-size: 1.3em; }
h3 { color: #00d4ff; margin-bottom: 10px; font-size: 1.1em; }
.subtitle { color: #888; margin-top: 5px; }
.panel {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.card {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.card:hover { 
    background: rgba(255,255,255,0.12);
    border-color: #00d4ff;
    transform: translateY(-2px);
}
.card-title { font-weight: 600; color: #fff; margin-bottom: 8px; }
.card-meta { font-size: 0.85em; color: #888; }
.face-card { display: flex; gap: 15px; align-items: center; cursor: default; }
.face-img {
    width: 80px; height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: #333;
}
.face-info { flex: 1; }
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-right: 5px;
    margin-top: 5px;
}
.tag-male { background: #1e88e5; }
.tag-female { background: #e91e63; }
.tag-success { background: #4caf50; }
.tag-warning { background: #ff9800; }
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
input, select {
    padding: 10px 15px;
    border: 1px solid #444;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 14px;
}
input:focus, select:focus { outline: none; border-color: #00d4ff; }
input::placeholder { color: #666; }
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #00d4ff;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
button:hover { background: #00b8e6; }
button:disabled { background: #555; color: #888; cursor: not-allowed; }
.btn-secondary { background: #444; color: #fff; }
.btn-secondary:hover { background: #555; }
.btn-success { background: #4caf50; }
.btn-success:hover { background: #43a047; }
.btn-danger { background: #f44336; }
.btn-danger:hover { background: #e53935; }
.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
}
.breadcrumb a { color: #00d4ff; text-decoration: none; }
.breadcrumb span { color: #666; }
.empty { text-align: center; padding: 40px; color: #666; }
.stats { display: flex; gap: 20px; margin-top: 10px; }
.stat { text-align: center; }
.stat-value { font-size: 1.5em; font-weight: 700; color: #00d4ff; }
.stat-label { font-size: 0.8em; color: #888; }
#loading { display: none; text-align: center; padding: 20px; }
.spinner {
    border: 3px solid #333;
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}
.modal-close:hover { color: #fff; }
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 0.9em;
}
.form-group input, .form-group select {
    width: 100%;
}
.form-row {
    display: flex;
    gap: 15px;
}
.form-row .form-group { flex: 1; }
.preview-img {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    background: #333;
    margin: 10px auto;
    display: block;
}
.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}
.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0; top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.file-input-label {
    display: block;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 2px dashed #444;
    border-radius: 8px;
    text-align: center;
    color: #888;
    transition: all 0.3s;
}
.file-input-wrapper:hover .file-input-label {
    border-color: #00d4ff;
    color: #00d4ff;
}

/* Webcam styles */
.webcam-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}
#webcam {
    width: 100%;
    border-radius: 10px;
    background: #000;
}
#webcamCanvas {
    display: none;
}
.webcam-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}
.result-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}
.result-match {
    display: flex;
    gap: 15px;
    align-items: center;
}
.result-match img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}
.result-info { flex: 1; }
.confidence-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}
.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #4caf50);
    border-radius: 3px;
    transition: width 0.3s;
}
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.alert-success { background: rgba(76, 175, 80, 0.2); border: 1px solid #4caf50; }
.alert-error { background: rgba(244, 67, 54, 0.2); border: 1px solid #f44336; }
.alert-info { background: rgba(0, 212, 255, 0.2); border: 1px solid #00d4ff; }

/* Identify tabs */
.identify-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}
.tab-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid #444;
    color: #888;
}
.tab-btn.active {
    background: #00d4ff;
    color: #000;
    border-color: #00d4ff;
}
.tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1);
}
.identify-tab-content {
    min-height: 200px;
}
