/* ===================================================
   Amlars Admin — Design System
   =================================================== */

:root {
    --admin-bg: #f0f2f5;
    --admin-surface: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #1a202c;
    --admin-text-muted: #718096;
    --admin-text-light: #a0aec0;
    --admin-accent: #667eea;
    --admin-accent-hover: #5a6fd6;
    --admin-accent-light: #ebf0ff;
    --admin-success: #38a169;
    --admin-warning: #d69e2e;
    --admin-danger: #e53e3e;
    --admin-info: #3182ce;
    --admin-radius: 10px;
    --admin-radius-sm: 6px;
    --admin-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --admin-shadow-md: 0 4px 12px rgba(0,0,0,.07);
    --admin-transition: 0.2s ease;
}

/* ---- Global ---- */
body {
    background: var(--admin-bg) !important;
    color: var(--admin-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sidebar-style Navbar ---- */
.navbar {
    background: var(--admin-surface) !important;
    box-shadow: var(--admin-shadow);
    border-bottom: 1px solid var(--admin-border) !important;
    padding: .65rem 1.25rem;
}

.navbar .nav-link {
    font-weight: 500;
    font-size: .875rem;
    color: var(--admin-text-muted) !important;
    padding: .45rem .85rem !important;
    border-radius: var(--admin-radius-sm);
    transition: all var(--admin-transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--admin-accent) !important;
    background: var(--admin-accent-light);
}

/* ---- Page Headers ---- */
.admin-page h1,
.container > h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--admin-text);
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    transition: box-shadow var(--admin-transition);
}

.card:hover {
    box-shadow: var(--admin-shadow-md);
}

.card-header {
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    padding: .85rem 1.15rem;
    font-weight: 600;
    font-size: .9rem;
}

.card-body {
    padding: 1.15rem;
}

/* ---- Stat Cards (dashboard) ---- */
.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .35rem;
}

.stat-card .stat-label {
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--admin-text-muted);
}

.stat-card.stat-green .stat-value  { color: var(--admin-success); }
.stat-card.stat-blue .stat-value   { color: var(--admin-info); }
.stat-card.stat-red .stat-value    { color: var(--admin-danger); }
.stat-card.stat-purple .stat-value { color: var(--admin-accent); }

/* ---- Stat Cards (new inline style) ---- */
.stat-card-wrap {
    border: 1px solid var(--admin-border);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon-green  { background: #e6fffa; color: #38a169; }
.stat-icon-blue   { background: #ebf8ff; color: #3182ce; }
.stat-icon-orange { background: #fffaf0; color: #dd6b20; }
.stat-icon-purple { background: #faf5ff; color: #805ad5; }

.stat-value-inline {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--admin-text);
}

.stat-label-inline {
    font-size: .78rem;
    font-weight: 500;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ---- Status Update rows ---- */
.status-update-row {
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--admin-border);
    transition: background var(--admin-transition);
}

.status-update-row:last-child {
    border-bottom: none;
}

.status-update-row:hover {
    background: #f7f9fc;
}

.status-update-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: .2rem;
}

.status-update-content {
    font-size: .82rem;
    color: var(--admin-text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

.status-update-time {
    font-size: .72rem;
    color: var(--admin-text-light);
    margin-top: .35rem;
}

/* ---- Project Cards ---- */
a.project-card {
    text-decoration: none;
    color: inherit;
    transition: transform var(--admin-transition), box-shadow var(--admin-transition);
}

a.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--admin-shadow-md);
    color: inherit;
    text-decoration: none;
}

/* ---- Tables ---- */
.table {
    margin-bottom: 0;
    font-size: .875rem;
}

.table thead th {
    background: #f7f8fa;
    border-bottom: 2px solid var(--admin-border);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--admin-text-muted);
    padding: .7rem 1rem;
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--admin-transition);
}

.table tbody tr:hover {
    background: #f7f9fc;
}

.table tbody td {
    padding: .7rem 1rem;
    vertical-align: middle;
    border-color: var(--admin-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #fafbfc;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: .72rem;
    padding: .3em .65em;
    border-radius: 5px;
    letter-spacing: .02em;
}

.badge.bg-secondary {
    background: #e2e8f0 !important;
    color: #4a5568 !important;
}

/* Status-specific badges */
.badge-status-live       { background: #c6f6d5 !important; color: #22543d !important; }
.badge-status-idea       { background: #e9d8fd !important; color: #44337a !important; }
.badge-status-development,
.badge-status-indevelopment { background: #bee3f8 !important; color: #2a4365 !important; }
.badge-status-archived   { background: #e2e8f0 !important; color: #4a5568 !important; }
.badge-status-abandoned  { background: #fed7d7 !important; color: #742a2a !important; }

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    font-size: .85rem;
    border-radius: var(--admin-radius-sm);
    padding: .45rem 1rem;
    transition: all var(--admin-transition);
}

.btn-primary {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
}

.btn-primary:hover {
    background: var(--admin-accent-hover);
    border-color: var(--admin-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, .35);
}

.btn-outline-primary {
    color: var(--admin-accent);
    border-color: var(--admin-accent);
}

.btn-outline-primary:hover {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    transform: translateY(-1px);
}

.btn-sm {
    font-size: .78rem;
    padding: .3rem .7rem;
}

/* Quick-action button group */
.quick-actions .btn {
    border-radius: var(--admin-radius-sm);
}

.quick-actions .btn i {
    opacity: .8;
}

.quick-actions .btn:hover i {
    opacity: 1;
}

/* ---- Forms ---- */
.form-control,
.form-select {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm);
    font-size: .875rem;
    padding: .5rem .75rem;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .15);
}

textarea.form-control {
    line-height: 1.6;
}

.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: .3rem;
}

.input-group .form-control,
.input-group .form-select {
    border-radius: var(--admin-radius-sm) 0 0 var(--admin-radius-sm);
}

.input-group .btn {
    border-radius: 0 var(--admin-radius-sm) var(--admin-radius-sm) 0;
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: .75rem;
    font-size: .85rem;
}

.breadcrumb-item a {
    color: var(--admin-accent);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--admin-text-muted);
}

/* ---- Alerts ---- */
.alert {
    border-radius: var(--admin-radius-sm);
    font-size: .875rem;
    border: none;
}

.alert-info {
    background: #ebf8ff;
    color: #2b6cb0;
    border-left: 4px solid var(--admin-info);
}

.alert-success {
    background: #f0fff4;
    color: #276749;
    border-left: 4px solid var(--admin-success);
}

.alert-warning {
    background: #fffff0;
    color: #975a16;
    border-left: 4px solid var(--admin-warning);
}

.alert-danger {
    background: #fff5f5;
    color: #c53030;
    border-left: 4px solid var(--admin-danger);
}

/* ---- Analytics summary row ---- */
.analytics-stat {
    text-align: center;
    padding: .75rem .5rem;
}

.analytics-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1.2;
}

.analytics-stat .label {
    font-size: .72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--admin-text-muted);
    margin-top: .2rem;
}

/* ---- Analytics table ---- */
.analytics-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.analytics-table thead th {
    background: transparent;
    color: #fff;
    border: none;
    font-size: .78rem;
}

.analytics-table .website-name {
    font-weight: 600;
    color: var(--admin-accent);
}

.analytics-table .property-id {
    font-size: .78rem;
    color: var(--admin-text-light);
    font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.analytics-table .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ---- Project detail ---- */
.project-header {
    margin-bottom: 1.5rem;
}

.project-header h1 {
    font-size: 1.75rem;
    margin-bottom: .25rem;
}

.project-meta a {
    color: var(--admin-accent);
    text-decoration: none;
    font-size: .875rem;
}

.project-meta a:hover {
    text-decoration: underline;
}

/* ---- Task rows ---- */
.task-row-done {
    opacity: .5;
}

/* ---- Email inbox ---- */
.email-unread {
    font-weight: 600;
    background: var(--admin-accent-light) !important;
}

.email-row {
    cursor: pointer;
    transition: background var(--admin-transition);
}

.email-row:hover {
    background: #f7f9fc !important;
}

/* ---- Code / API keys ---- */
code {
    background: #f7f8fa;
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .82rem;
    color: var(--admin-accent);
    user-select: all;
}

/* ---- Empty states ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--admin-text-muted);
}

.empty-state p {
    margin: 0;
    font-size: .9rem;
}

/* ---- Footer ---- */
.footer {
    background: var(--admin-surface);
    border-top: 1px solid var(--admin-border) !important;
}

.footer a {
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: color var(--admin-transition);
}

.footer a:hover {
    color: var(--admin-accent);
}

/* ---- Utility ---- */
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

/* Smooth page load */
main {
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive tweaks ---- */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.75rem;
    }

    .analytics-stat .value {
        font-size: 1.15rem;
    }
}
