/* ============================================================================
   WalletPass - Styles principaux
   ============================================================================ */

:root {
    --primary: #2c3e50;
    --primary-light: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --bg: #f4f6f9;
    --card-bg: #fff;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #dce1e6;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navbar --- */
.navbar {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}
.nav-links {
    display: flex;
    gap: 4px;
    margin-left: 40px;
}
.nav-links a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,.15);
}
.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255,255,255,.8);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card h2, .card h3 {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg);
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; }

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d5f5e3; color: #1e8449; }
.alert-error   { background: #fadbd8; color: #c0392b; }
.alert-warning { background: #fdebd0; color: #b9770e; }
.alert-info    { background: #d6eaf8; color: #2471a3; }

/* --- Buttons --- */
.btn, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.btn-primary   { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #c0392b; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 6px 12px; }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-sm        { padding: 6px 12px; font-size: 13px; }
.btn-icon      { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
tr:hover { background: #f8f9fa; }

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group small { color: var(--text-muted); font-size: 12px; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Color input */
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-input-wrap input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}
.color-input-wrap input[type="text"] {
    width: 120px;
}

/* --- Dashboard grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-icon.blue   { background: #d6eaf8; }
.stat-icon.green  { background: #d5f5e3; }
.stat-icon.orange { background: #fdebd0; }
.stat-icon.red    { background: #fadbd8; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* --- Status badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #d5f5e3; color: #1e8449; }
.badge-danger  { background: #fadbd8; color: #c0392b; }
.badge-warning { background: #fdebd0; color: #b9770e; }
.badge-info    { background: #d6eaf8; color: #2471a3; }
.badge-muted   { background: #eaecee; color: #7f8c8d; }

/* --- Checkbox toggle --- */
.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- Sections --- */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 12px;
}

/* --- Two-column layout --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
}

/* --- Preview panels --- */
.preview-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 400px;
    background: #fafbfc;
}
.preview-frame iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: var(--radius);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* --- Login page --- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.login-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    padding: 40px;
    width: 400px;
    max-width: 90vw;
}
.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
}
.login-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}

/* --- Test result --- */
.test-result {
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}
.test-result.visible { display: block; }
.test-result.ok   { background: #d5f5e3; color: #1e8449; }
.test-result.fail { background: #fadbd8; color: #c0392b; }

/* --- Image preview --- */
.img-preview {
    margin-top: 8px;
}
.img-preview img {
    max-height: 60px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

/* --- Action links --- */
.actions { display: flex; gap: 8px; }
