* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; font-size: 14px; }

/* Nav */
.nav { background: #1a1a2e; padding: 0 20px; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { color: #fff; font-size: 18px; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-logo { height: 28px; width: auto; filter: brightness(0) invert(1); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: #aaa; text-decoration: none; font-size: 14px; padding: 6px 0; border-bottom: 2px solid transparent; position: relative; }
.nav-links a:hover, .nav-links a.active { color: #fff; border-bottom-color: #d12127; }
.nav-user { color: #888; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.nav-logout { color: #d12127 !important; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; background: #d12127; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; margin-left: 4px; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
h1 { font-size: 24px; margin-bottom: 20px; color: #1a1a2e; }
h2 { font-size: 18px; margin: 20px 0 12px; color: #1a1a2e; }
h3 { font-size: 15px; color: #1a1a2e; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert a { color: inherit; font-weight: 600; }
.alert ol { margin: 8px 0 0 20px; }

/* Site selector */
.site-selector { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; padding: 12px 16px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.site-selector label { font-weight: 600; font-size: 13px; color: #555; text-transform: uppercase; margin-right: 4px; }

/* Search */
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input { padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; width: 300px; }
.search-input:focus { outline: none; border-color: #1a1a2e; }
.count-label { color: #888; font-size: 13px; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.table th { background: #f8f9fa; padding: 10px 14px; text-align: left; font-size: 12px; text-transform: uppercase; color: #666; border-bottom: 2px solid #dee2e6; }
.table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.table tbody tr.row-even { background: #fff; }
.table tbody tr.row-odd { background: #f8f9fb; }
.table tbody tr:hover { background: #eef1f7; }
.table tbody tr:last-child td { border-bottom: none; }
.row-disabled { opacity: 0.5; }

/* Phone display */
.phone-display { font-family: 'SF Mono', Monaco, monospace; font-size: 15px; font-weight: 500; }
.text-muted { color: #999; font-size: 11px; }

/* Organic number - nested below primary */
.organic-row { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.organic-label-inline { font-size: 9px; font-weight: 600; text-transform: uppercase; color: #999; letter-spacing: 0.5px; background: #f0f0f0; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.phone-display-organic { font-family: 'SF Mono', Monaco, monospace; font-size: 12px; color: #888; }
.btn-edit-organic { font-size: 11px; opacity: 0.7; }

/* Time inputs */
.time-input { width: 110px !important; padding: 6px 8px; font-size: 14px; font-family: 'SF Mono', Monaco, monospace; }

/* Branding page */
.branding-status { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.branding-card h3 { font-size: 14px; margin-bottom: 10px; }
.branding-preview { background: #1a1a2e; border-radius: 8px; padding: 20px; text-align: center; }
.logo-preview { max-width: 200px; max-height: 80px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.logo-option { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; border: 2px solid #eee; border-radius: 8px; background: #fff; text-align: center; transition: border-color 0.15s; }
.logo-option:hover { border-color: #1a1a2e; }
.logo-option.logo-active { border-color: #28a745; background: #f8fff8; }
.logo-option img { max-width: 150px; max-height: 60px; object-fit: contain; }
.logo-name { font-size: 12px; font-weight: 600; color: #555; }

/* No organic page indicator */
.no-organic { font-size: 11px; color: #ccc; }
.no-organic-tag { display: inline-block; font-size: 9px; font-weight: 600; text-transform: uppercase; color: #fff; background: #dc3545; padding: 1px 5px; border-radius: 3px; margin-left: 3px; vertical-align: middle; }
.organic-label { font-size: 11px; }
.text-center { text-align: center; }

/* Buttons */
.btn { display: inline-block; padding: 7px 14px; border: none; border-radius: 5px; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; line-height: 1.4; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: #1a1a2e; color: #fff; }
.btn-primary:hover { background: #16213e; }
.btn-success { background: #28a745; color: #fff; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-edit { background: #e9ecef; color: #333; }
.btn-edit:hover { background: #dee2e6; }
.btn-cancel { background: #f8f9fa; color: #666; border: 1px solid #ddd; }
.btn-full { width: 100%; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 2px; }
.actions-cell form { display: inline; }

/* Edit form inline */
.edit-form { display: flex; gap: 6px; align-items: center; }
.edit-input { padding: 5px 8px; border: 1px solid #1a1a2e; border-radius: 4px; font-size: 14px; font-family: monospace; width: 160px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; text-transform: uppercase; }
.form-group input, .form-group select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; width: 100%; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1a1a2e; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* Password toggle */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 60px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 1px solid #ddd; border-radius: 3px; padding: 3px 8px; font-size: 12px; color: #666; cursor: pointer; }
.password-toggle:hover { background: #f0f0f0; }

/* Card */
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }

/* County grid */
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; max-height: 300px; overflow-y: auto; border: 1px solid #eee; padding: 10px 12px; border-radius: 5px; background: #fafafa; }
.checkbox-label { display: flex; align-items: center; font-size: 13px; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.checkbox-label input { margin-right: 6px; flex-shrink: 0; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.badge-full_access { background: #e8f5e9; color: #2e7d32; }
.badge-approver { background: #e3f2fd; color: #1565c0; }
.badge-standard { background: #fff3e0; color: #e65100; }
.badge-admin { background: #e3f2fd; color: #1565c0; }
.badge-manager { background: #fff3e0; color: #e65100; }
.badge-action { background: #f3e5f5; color: #7b1fa2; }
.badge-local { background: #e8f5e9; color: #2e7d32; }
.badge-remote { background: #fff3e0; color: #e65100; }

/* Status */
.status-active { color: #28a745; font-weight: 600; }
.status-inactive { color: #dc3545; font-weight: 600; }
.status-pending { color: #e65100; font-weight: 600; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 380px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.login-box h1 { text-align: center; color: #1a1a2e; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: #888; margin-bottom: 24px; font-size: 14px; }
.login-footer { text-align: center; margin-top: 16px; font-size: 13px; }
.login-footer a { color: #1a1a2e; }

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

/* Domain link in table */
.domain-link { color: #1565c0; text-decoration: none; font-size: 11px; }
.domain-link:hover { text-decoration: underline; }

/* Upload review */
/* Badge picker */
.badge-picker { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; border: 1px solid #eee; border-radius: 5px; background: #fafafa; max-height: 320px; overflow-y: auto; }
.badge-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid transparent; border-radius: 6px; cursor: pointer; width: 120px; transition: border-color 0.15s, opacity 0.15s; }
.badge-option:hover { border-color: #ccc; }
.badge-option input[type="radio"] { display: none; }
.badge-option input[type="radio"]:checked + img { outline: 3px solid #1a1a2e; outline-offset: 2px; }
.badge-option img { max-width: 90px; max-height: 90px; border-radius: 4px; }
.badge-filename { font-size: 10px; color: #888; text-align: center; word-break: break-word; line-height: 1.2; }

/* Upload review */
.upload-review { margin: 20px 0; }
.upload-review table .changed { background: #fff8e1; }
.upload-review table .changed td { font-weight: 500; }
.upload-review .change-arrow { color: #999; margin: 0 4px; }
.upload-review .new-value { color: #2e7d32; font-weight: 600; }
