/* ═══════════════════════════════════════════════════════════
   MinhTamCoconut Admin Panel — admin.css
═══════════════════════════════════════════════════════════ */

:root {
    --a-bg:       #f8faf9;
    --a-sidebar:  #0f2d18;
    --a-sidebar2: #1a3d24;
    --a-accent:   #3aaa56;
    --a-accent2:  #2d8f45;
    --a-gold:     #c8973a;
    --a-white:    #ffffff;
    --a-ink:      #1a2e1f;
    --a-muted:    #6b7f72;
    --a-line:     #e4ebe6;
    --a-danger:   #dc3545;
    --a-warning:  #f59e0b;
    --a-info:     #3b82f6;
    --a-success:  #3aaa56;
    --a-shadow:   rgba(58,170,86,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body.admin-body {
    font-family: 'DM Sans', sans-serif;
    background: var(--a-bg);
    color: var(--a-ink);
    min-height: 100vh;
    display: flex;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.a-sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--a-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.a-sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}

.a-brand-mark {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--a-accent), var(--a-accent2));
    border-radius: 10px 3px 10px 3px;
    transform: rotate(12deg);
    flex-shrink: 0;
}

.a-brand-text { display: flex; flex-direction: column; line-height: 1; }

.a-brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem; font-weight: 600; color: white; letter-spacing: 1px;
}

.a-brand-name span { color: var(--a-accent); }
.a-brand-sub { font-size: 0.6rem; color: rgba(255,255,255,0.35); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

/* Nav sections */
.a-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.a-nav-section { margin-bottom: 6px; }

.a-nav-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: rgba(255,255,255,0.28);
    padding: 10px 20px 6px;
}

.a-nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.55);
    text-decoration: none; font-size: 0.85rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.a-nav-link:hover { color: white; background: rgba(255,255,255,0.05); }

.a-nav-link.active {
    color: white;
    background: rgba(58,170,86,0.15);
    border-left-color: var(--a-accent);
}

.a-nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.a-nav-badge {
    margin-left: auto;
    background: var(--a-danger);
    color: white; font-size: 0.62rem; font-weight: 700;
    padding: 2px 7px; border-radius: 10px;
    min-width: 20px; text-align: center;
}

.a-nav-badge.gold { background: var(--a-gold); color: var(--a-sidebar); }

/* Sidebar footer */
.a-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.a-user-info {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}

.a-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--a-accent), var(--a-accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: white; font-weight: 700; flex-shrink: 0;
}

.a-user-name  { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.a-user-role  { font-size: 0.68rem; color: rgba(255,255,255,0.35); margin-top: 1px; }

.a-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 10px; width: 100%;
    background: rgba(220,53,69,0.12); border: 1px solid rgba(220,53,69,0.2);
    color: #f87171; font-size: 0.8rem; font-weight: 600;
    font-family: 'DM Sans', sans-serif; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
    justify-content: center;
}

.a-logout:hover { background: rgba(220,53,69,0.22); color: white; }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.a-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top bar */
.a-topbar {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--a-line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}

.a-topbar-left { display: flex; align-items: center; gap: 14px; }

.a-page-title  { font-size: 1rem; font-weight: 700; color: var(--a-ink); }

.a-breadcrumb  {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.75rem; color: var(--a-muted); list-style: none;
}

.a-breadcrumb li + li::before { content: '/'; margin-right: 5px; color: var(--a-line); }
.a-breadcrumb a { color: var(--a-accent); text-decoration: none; }

.a-topbar-right { display: flex; align-items: center; gap: 10px; }

.a-topbar-btn {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--a-bg); border: 1px solid var(--a-line);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; cursor: pointer; transition: all 0.2s;
    position: relative; text-decoration: none; color: var(--a-muted);
}

.a-topbar-btn:hover { background: var(--a-accent); color: white; border-color: var(--a-accent); }

.a-notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--a-danger); border: 1.5px solid white;
}

/* ── PAGE BODY ────────────────────────────────────────────── */
.a-content { padding: 28px; flex: 1; }

/* ── STATS CARDS ─────────────────────────────────────────── */
.a-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.a-stat-card {
    background: white;
    border: 1px solid var(--a-line);
    border-radius: 18px;
    padding: 22px 20px;
    transition: all 0.3s;
    position: relative; overflow: hidden;
}

.a-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--a-shadow);
}

.a-stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 18px 18px 0 0;
}

.a-stat-card.green::before  { background: var(--a-accent); }
.a-stat-card.gold::before   { background: var(--a-gold); }
.a-stat-card.blue::before   { background: var(--a-info); }
.a-stat-card.red::before    { background: var(--a-danger); }

.a-stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 14px;
}

.a-stat-card.green .a-stat-icon  { background: rgba(58,170,86,0.1); }
.a-stat-card.gold  .a-stat-icon  { background: rgba(200,151,58,0.1); }
.a-stat-card.blue  .a-stat-icon  { background: rgba(59,130,246,0.1); }
.a-stat-card.red   .a-stat-icon  { background: rgba(220,53,69,0.1); }

.a-stat-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem; font-weight: 600; color: var(--a-ink); line-height: 1;
}

.a-stat-label {
    font-size: 0.78rem; color: var(--a-muted); margin-top: 4px;
}

.a-stat-change {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 600; margin-top: 8px;
}

.a-stat-change.up   { color: var(--a-success); }
.a-stat-change.down { color: var(--a-danger); }

/* ── CARD ─────────────────────────────────────────────────── */
.a-card {
    background: white;
    border: 1px solid var(--a-line);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 24px;
}

.a-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--a-line);
    display: flex; align-items: center; justify-content: space-between;
}

.a-card-title {
    font-size: 0.92rem; font-weight: 700; color: var(--a-ink);
    display: flex; align-items: center; gap: 8px;
}

.a-card-body { padding: 24px; }

/* ── TABLE ────────────────────────────────────────────────── */
.a-table-wrap { overflow-x: auto; }

.a-table {
    width: 100%; border-collapse: collapse; font-size: 0.84rem;
}

.a-table thead tr {
    background: var(--a-bg);
    border-bottom: 1px solid var(--a-line);
}

.a-table th {
    padding: 11px 16px; text-align: left;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--a-muted); white-space: nowrap;
}

.a-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--a-line);
    color: var(--a-ink); vertical-align: middle;
}

.a-table tbody tr:last-child td { border-bottom: none; }

.a-table tbody tr:hover td { background: var(--a-bg); }

.a-table .td-img {
    width: 44px; height: 44px; border-radius: 10px;
    object-fit: cover; display: block;
    background: #e4ebe6;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.a-table .td-name { font-weight: 600; color: var(--a-ink); }
.a-table .td-sub  { font-size: 0.75rem; color: var(--a-muted); margin-top: 2px; }

/* ── BADGES ─────────────────────────────────────────────── */
.a-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}

.a-badge-green   { background: rgba(58,170,86,0.12); color: #1f6b31; }
.a-badge-red     { background: rgba(220,53,69,0.1);  color: #b91c1c; }
.a-badge-gold    { background: rgba(200,151,58,0.12); color: #92580a; }
.a-badge-blue    { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.a-badge-gray    { background: rgba(107,127,114,0.1); color: var(--a-muted); }

/* ── ACTION BUTTONS ─────────────────────────────────────── */
.a-actions { display: flex; gap: 6px; }

.a-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 10px; border: none;
    font-size: 0.78rem; font-weight: 600;
    font-family: 'DM Sans', sans-serif; cursor: pointer;
    text-decoration: none; transition: all 0.2s;
}

.a-btn-sm { padding: 5px 10px; font-size: 0.72rem; }

.a-btn-primary {
    background: var(--a-accent); color: white;
    box-shadow: 0 3px 10px rgba(58,170,86,0.25);
}
.a-btn-primary:hover { background: var(--a-accent2); color: white; }

.a-btn-outline {
    background: white; color: var(--a-ink);
    border: 1px solid var(--a-line);
}
.a-btn-outline:hover { border-color: var(--a-accent); color: var(--a-accent); }

.a-btn-danger {
    background: rgba(220,53,69,0.1); color: var(--a-danger);
    border: 1px solid rgba(220,53,69,0.2);
}
.a-btn-danger:hover { background: var(--a-danger); color: white; }

.a-btn-warning {
    background: rgba(245,158,11,0.1); color: var(--a-warning);
    border: 1px solid rgba(245,158,11,0.2);
}
.a-btn-warning:hover { background: var(--a-warning); color: white; }

.a-btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; }

/* ── FORM STYLES (Admin) ────────────────────────────────── */
.a-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.a-form-grid .full { grid-column: 1 / -1; }

.a-form-group { display: flex; flex-direction: column; }

.a-label {
    font-size: 0.75rem; font-weight: 700; color: var(--a-muted);
    letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 7px;
}

.a-label .req { color: var(--a-danger); margin-left: 2px; }

.a-input, .a-select, .a-textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--a-line); border-radius: 12px;
    font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
    color: var(--a-ink); background: white; outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.a-input:focus, .a-select:focus, .a-textarea:focus {
    border-color: var(--a-accent);
    box-shadow: 0 0 0 3px rgba(58,170,86,0.1);
}

.a-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.a-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7f72' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.a-input.error, .a-select.error, .a-textarea.error {
    border-color: var(--a-danger);
}

.a-field-error {
    font-size: 0.73rem; color: var(--a-danger); margin-top: 5px;
}

.a-toggle-wrap {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 12px;
    border: 1.5px solid var(--a-line); background: var(--a-bg);
}

.a-toggle {
    width: 18px; height: 18px; accent-color: var(--a-accent); cursor: pointer;
}

.a-toggle-label { font-size: 0.86rem; color: var(--a-ink); font-weight: 500; cursor: pointer; }

/* Image preview */
.a-img-preview {
    width: 100%; max-height: 200px; object-fit: cover;
    border-radius: 12px; border: 1px solid var(--a-line);
    margin-top: 8px; display: none;
}

/* ── SEARCH / FILTER BAR ────────────────────────────────── */
.a-toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}

.a-search-wrap { position: relative; }

.a-search {
    padding: 9px 36px 9px 14px;
    border: 1.5px solid var(--a-line); border-radius: 12px;
    font-family: 'DM Sans', sans-serif; font-size: 0.85rem;
    color: var(--a-ink); width: 240px; outline: none;
    transition: border-color 0.25s;
}

.a-search:focus { border-color: var(--a-accent); }
.a-search::placeholder { color: var(--a-muted); }

.a-search-icon {
    position: absolute; right: 11px; top: 50%;
    transform: translateY(-50%); color: var(--a-muted); font-size: 0.9rem;
}

.a-filter-select {
    padding: 9px 32px 9px 12px;
    border: 1.5px solid var(--a-line); border-radius: 12px;
    font-family: 'DM Sans', sans-serif; font-size: 0.84rem;
    color: var(--a-ink); outline: none; background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7f72' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    transition: border-color 0.25s;
}

.a-filter-select:focus { border-color: var(--a-accent); }

/* ── PAGINATION ─────────────────────────────────────────── */
.a-pagination {
    display: flex; align-items: center; gap: 6px;
    padding: 16px 24px; border-top: 1px solid var(--a-line);
}

.a-page-info { font-size: 0.78rem; color: var(--a-muted); margin-right: auto; }

.a-page-btn {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
    border: 1px solid var(--a-line); background: white;
    color: var(--a-ink); text-decoration: none; transition: all 0.2s;
}

.a-page-btn:hover  { border-color: var(--a-accent); color: var(--a-accent); }
.a-page-btn.active { background: var(--a-accent); color: white; border-color: var(--a-accent); }
.a-page-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ── ALERTS ─────────────────────────────────────────────── */
.a-alert {
    padding: 13px 18px; border-radius: 12px; margin-bottom: 18px;
    font-size: 0.85rem; display: flex; align-items: center; gap: 10px;
}

.a-alert-success { background: rgba(58,170,86,0.1); border: 1px solid rgba(58,170,86,0.25); color: #1f6b31; }
.a-alert-error   { background: rgba(220,53,69,0.08); border: 1px solid rgba(220,53,69,0.2); color: #b91c1c; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .a-stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .a-sidebar { transform: translateX(-100%); }
    .a-sidebar.open { transform: translateX(0); }
    .a-main { margin-left: 0; }
    .a-stats-grid { grid-template-columns: 1fr 1fr; }
    .a-form-grid  { grid-template-columns: 1fr; }
    .a-form-grid .full { grid-column: 1; }
}
