/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: #222; background: #f5f5f5; line-height: 1.5; }

/* === LOGIN === */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #f0f0f0; }
.login-box { background: #fff; padding: 2.5rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); width: 100%; max-width: 380px; }
.login-box h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.login-subtitle { color: #666; font-size: .85rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; color: #444; }
.form-group input, .form-group select { width: 100%; padding: .5rem .75rem; border: 1px solid #ccc; border-radius: 4px; font-size: .9rem; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 2px rgba(0,102,204,.15); }
#login-btn { width: 100%; padding: .6rem; background: #222; color: #fff; border: none; border-radius: 4px; font-size: .9rem; cursor: pointer; margin-top: .5rem; }
#login-btn:hover { background: #444; }
.error-text { color: #dc3545; font-size: .85rem; margin-top: .5rem; }

/* === LAYOUT === */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 48px; background: #222; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 0 1rem; z-index: 100; }
.topbar h2 { font-size: 1rem; font-weight: 600; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: .75rem; }
.menu-btn { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; display: none; }
.user-badge { font-size: .85rem; color: #aaa; }

.sidebar { position: fixed; top: 48px; left: 0; bottom: 0; width: 200px; background: #fff; border-right: 1px solid #e0e0e0; overflow-y: auto; z-index: 90; }
.nav-item { display: block; padding: .65rem 1rem; color: #444; text-decoration: none; font-size: .85rem; border-left: 3px solid transparent; }
.nav-item:hover { background: #f8f8f8; color: #222; }
.nav-item.active { background: #f0f4ff; color: #0066cc; border-left-color: #0066cc; font-weight: 600; }

.content { margin-left: 200px; margin-top: 48px; padding: 1.25rem; min-height: calc(100vh - 48px); }

/* === COMPONENTS === */
.btn { padding: .4rem .8rem; border: 1px solid #ccc; background: #fff; border-radius: 4px; font-size: .8rem; cursor: pointer; }
.btn:hover { background: #f0f0f0; }
.btn-sm { padding: .25rem .5rem; font-size: .75rem; }
.btn-danger { border-color: #dc3545; color: #dc3545; }
.btn-danger:hover { background: #dc3545; color: #fff; }
.btn-success { border-color: #28a745; color: #28a745; }
.btn-success:hover { background: #28a745; color: #fff; }
.btn-primary { border-color: #0066cc; color: #0066cc; }
.btn-primary:hover { background: #0066cc; color: #fff; }

/* Status dots */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: #28a745; }
.dot-red { background: #dc3545; }
.dot-yellow { background: #ffc107; }
.dot-grey { background: #999; }

/* Tags */
.tag { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: .7rem; font-weight: 600; }
.tag-production { background: #fce4e4; color: #c0392b; }
.tag-test { background: #e3f2fd; color: #1565c0; }
.tag-development { background: #e8f5e9; color: #2e7d32; }
.tag-custom { background: #f5f5f5; color: #666; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; padding: 8px 12px; background: #f8f9fa; border-bottom: 2px solid #dee2e6; font-weight: 600; color: #555; font-size: .8rem; }
td { padding: 6px 12px; border-bottom: 1px solid #eee; }
tr:hover { background: #fafafa; }
.table-container { overflow-x: auto; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 1rem; }
.card-title { font-size: .75rem; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .25rem; }
.card-value { font-size: 1.5rem; font-weight: 700; }
.card-value.green { color: #28a745; }
.card-value.red { color: #dc3545; }
.card-value.yellow { color: #e67e22; }

/* Search */
.toolbar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: .4rem .6rem; border: 1px solid #ccc; border-radius: 4px; font-size: .85rem; }
.toolbar input { min-width: 200px; }

/* Progress */
.progress-bar-container { width: 100%; height: 20px; background: #e9ecef; border-radius: 4px; overflow: hidden; margin: 1rem 0; }
.progress-bar { height: 100%; background: #0066cc; transition: width .3s ease; border-radius: 4px; }
.progress-phase { font-weight: 600; font-size: .9rem; }
.progress-msg { color: #666; font-size: .85rem; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); display: flex; justify-content: center; align-items: center; z-index: 200; }
.modal-content { background: #fff; padding: 1.5rem; border-radius: 8px; min-width: 360px; max-width: 90vw; }
.modal-content h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }

/* Loading */
.loading { text-align: center; padding: 3rem; color: #999; }

/* Alerts banner */
.alert-banner { padding: .5rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: .85rem; }
.alert-danger { background: #fce4e4; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Page title */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.page-header h1 { font-size: 1.3rem; font-weight: 600; }

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .menu-btn { display: block; }
    .sidebar { transform: translateX(-100%); transition: transform .2s; width: 240px; }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 1rem; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .toolbar { flex-direction: column; }
    .toolbar input { min-width: 100%; }
    .modal-content { min-width: auto; margin: 1rem; }
    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
    .cards { grid-template-columns: 1fr; }
    .topbar h2 { font-size: .9rem; }
    .login-box { margin: 1rem; padding: 1.5rem; }
}
