:root {
    --a-bg: #f4f5f7;
    --a-panel: #ffffff;
    --a-ink: #1a1f29;
    --a-ink-soft: #54606e;
    --a-muted: #8e98a4;
    --a-line: #e3e6eb;
    --a-accent: #2a6df4;
    --a-accent-soft: #e6efff;
    --a-danger: #d23a3a;
    --a-success: #2a8b4f;
    --a-warn: #c98a16;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--a-bg);
    color: var(--a-ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--a-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; color: var(--a-ink); }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* Sidebar */
.a-side {
    position: fixed; inset: 0 auto 0 0;
    width: 240px; padding: 24px 16px;
    background: #0f1421;
    color: rgba(255,255,255,0.8);
    display: flex; flex-direction: column; gap: 20px;
}
.a-brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px; }
.a-brand-mark {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: #fff; color: #0f1421;
    font-weight: 700; font-size: 18px;
    border-radius: 6px;
}
.a-brand strong { display: block; color: #fff; font-size: 15px; }
.a-brand small { color: rgba(255,255,255,0.5); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.a-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.a-nav-link {
    display: block; padding: 10px 12px;
    color: rgba(255,255,255,0.7); border-radius: 6px;
    font-size: 14px; transition: background .15s;
}
.a-nav-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.a-nav-link.active { background: rgba(255,255,255,0.1); color: #fff; }

.a-side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.a-who { font-size: 12px; color: rgba(255,255,255,0.55); }

/* Main */
.a-main { margin-left: 240px; padding: 32px 36px; min-height: 100vh; }
.a-main-public { margin-left: 0; display: grid; place-items: center; background: var(--a-bg); }

@media (max-width: 880px) {
    .a-side { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 10px; }
    .a-side .a-brand { flex: 1; }
    .a-nav { flex-direction: row; flex-wrap: wrap; }
    .a-side-bottom { flex-direction: row; align-items: center; }
    .a-main { margin-left: 0; padding: 20px 16px; }
}

/* Page header */
.a-page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.a-page-head h1 { margin: 0; }
.a-tools { display: flex; gap: 8px; align-items: center; }

/* Panels */
.a-panel {
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

/* Buttons */
.a-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    background: var(--a-accent); color: #fff;
    border: 1px solid var(--a-accent);
    border-radius: 6px;
    font: inherit; font-weight: 500;
    cursor: pointer;
    transition: opacity .15s, background .15s;
}
.a-btn:hover { background: #1f5cd9; }
.a-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.a-btn-ghost { background: transparent; color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }
.a-btn-ghost:hover { background: rgba(255,255,255,0.08); }
.a-btn-secondary { background: #fff; color: var(--a-ink); border-color: var(--a-line); }
.a-btn-secondary:hover { background: #f7f8fa; }
.a-btn-danger { background: var(--a-danger); border-color: var(--a-danger); }
.a-btn-danger:hover { background: #b22d2d; }
.a-btn-sm { padding: 6px 10px; font-size: 13px; }

/* Forms */
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.a-form-field { display: flex; flex-direction: column; }
.a-form-field.full { grid-column: 1 / -1; }
.a-form-field label {
    font-size: 12px; color: var(--a-ink-soft); margin-bottom: 6px; font-weight: 500;
}
.a-form-field input,
.a-form-field select,
.a-form-field textarea {
    padding: 9px 12px;
    border: 1px solid var(--a-line);
    border-radius: 6px;
    background: #fff;
    font: inherit; color: var(--a-ink);
}
.a-form-field input:focus,
.a-form-field select:focus,
.a-form-field textarea:focus { outline: 2px solid var(--a-accent-soft); border-color: var(--a-accent); }
.a-form-field textarea { min-height: 90px; resize: vertical; }
.a-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

@media (max-width: 680px) { .a-form-grid { grid-template-columns: 1fr; } }

/* Tables */
.a-table {
    width: 100%; border-collapse: collapse;
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    border-radius: 8px;
    overflow: hidden;
}
.a-table th, .a-table td {
    padding: 12px 14px; text-align: left;
    border-bottom: 1px solid var(--a-line);
    vertical-align: middle;
}
.a-table th {
    font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--a-muted); background: #fafbfc; font-weight: 600;
}
.a-table tr:last-child td { border-bottom: 0; }
.a-table .a-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Status badges */
.a-status {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.a-status-new       { background: #e6efff; color: #1f4ec0; }
.a-status-contacted { background: #fff3d6; color: #8a5a00; }
.a-status-confirmed { background: #dff5e6; color: #1d6e3a; }
.a-status-cancelled { background: #ffe3e3; color: #9c2a2a; }

/* Login */
.a-login-card {
    width: 100%; max-width: 380px;
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    border-radius: 10px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(20, 30, 50, 0.08);
}
.a-login-card h1 { text-align: center; margin-bottom: 24px; }
.a-login-card .a-form-field { margin-bottom: 14px; }
.a-login-card .a-btn { width: 100%; justify-content: center; }

/* Stats / dashboard */
.a-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.a-stat {
    background: var(--a-panel); border: 1px solid var(--a-line);
    border-radius: 8px; padding: 18px 20px;
}
.a-stat-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--a-muted); margin-bottom: 6px; }
.a-stat-value { font-size: 28px; font-weight: 700; }
@media (max-width: 880px) { .a-stats { grid-template-columns: repeat(2, 1fr); } }

/* Photo grid */
.a-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.a-photo {
    position: relative; aspect-ratio: 4/3;
    border: 1px solid var(--a-line); border-radius: 6px; overflow: hidden;
    background: #f4f5f7 center/cover no-repeat;
}
.a-photo-actions {
    position: absolute; inset: auto 0 0 0;
    display: flex; gap: 4px; padding: 6px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
}
.a-photo-actions button {
    flex: 1; font-size: 11px; padding: 4px 6px;
    background: rgba(255,255,255,0.9); color: var(--a-ink);
    border: 0; border-radius: 4px; cursor: pointer;
}
.a-photo-actions button.danger { background: rgba(210,58,58,0.9); color: #fff; }
.a-photo-actions button:hover { opacity: 0.9; }
.a-photo .primary-badge {
    position: absolute; top: 6px; left: 6px;
    background: var(--a-accent); color: #fff;
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
}

/* Dropzone */
.a-dropzone {
    border: 2px dashed var(--a-line);
    border-radius: 8px;
    padding: 28px;
    text-align: center;
    color: var(--a-muted);
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.a-dropzone.dragover { border-color: var(--a-accent); background: var(--a-accent-soft); color: var(--a-accent); }
.a-dropzone input { display: none; }

/* Alerts */
.a-alert { padding: 12px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.a-alert-error { background: #ffe3e3; color: #9c2a2a; border: 1px solid #f1c0c0; }
.a-alert-success { background: #dff5e6; color: #1d6e3a; border: 1px solid #b9e3c8; }

/* Tabs / filters */
.a-filters { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.a-filter {
    padding: 6px 12px;
    background: #fff; border: 1px solid var(--a-line);
    border-radius: 999px;
    cursor: pointer; font-size: 13px;
}
.a-filter.active { background: var(--a-ink); color: #fff; border-color: var(--a-ink); }

.a-muted { color: var(--a-muted); }
.a-mt { margin-top: 14px; }

/* Contact list editor */
.a-contact-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; margin-bottom: 14px; }
.a-contact-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 10px; align-items: center; }
.a-contact-row select,
.a-contact-row input {
    height: 38px; padding: 0 10px;
    border: 1px solid var(--a-line); border-radius: 6px;
    background: #fff; font-size: 14px;
    width: 100%;
}
.a-contact-row select:focus,
.a-contact-row input:focus { outline: 2px solid var(--a-accent-soft); border-color: var(--a-accent); }
.a-contact-remove { line-height: 1; }
@media (max-width: 680px) {
    .a-contact-row { grid-template-columns: 1fr auto; }
    .a-contact-row select { grid-column: 1 / -1; }
}
