/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: #f5f5f7; color: #1d1d1f; font-size: 14px; }

/* Nav */
nav { background: #1d1d1f; color: #fff; display: flex; align-items: center;
      justify-content: space-between; padding: 0 32px; height: 52px; }
.nav-brand { font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.nav-brand span { color: #6e6e73; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: #ebebf0; text-decoration: none; padding: 6px 14px;
               border-radius: 6px; transition: background .15s; font-size: 13px; }
.nav-links a:hover, .nav-links a.active { background: #2d2d2f; }
.btn-logout { background: #3a3a3c !important; }

/* Main layout */
main { max-width: 1300px; margin: 0 auto; padding: 32px 24px; }

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

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
         gap: 12px; margin-bottom: 32px; }
.card { background: #fff; border-radius: 12px; padding: 20px 20px 16px;
        box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.card-label { font-size: 11px; font-weight: 500; color: #6e6e73;
              text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; line-height: 1; }
.card-value.small { font-size: 16px; }
.card-sub { font-size: 12px; color: #6e6e73; margin-top: 6px; }

/* Section row */
.section-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.section-half h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff;
        border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
th { background: #f5f5f7; padding: 10px 12px; text-align: left; font-size: 12px;
     font-weight: 500; color: #6e6e73; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 9px 12px; border-top: 1px solid #f0f0f2; vertical-align: middle; }
tr:hover td { background: #fafafa; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: #6e6e73; }
.name-cell { max-width: 280px; }
.thumb { width: 55px; height: 55px; object-fit: cover; border-radius: 4px; display: block; }
.thumb-cell { width: 67px; padding: 4px 8px; }
.table-wrap { overflow-x: auto; }
.products-table td { white-space: nowrap; }
.products-table .name-cell { white-space: normal; }

/* Tags & chips */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px;
       font-size: 11px; font-weight: 500; }
.tag-ok   { background: #d1f7e0; color: #1a7a3e; }
.tag-warn { background: #fff3cd; color: #8a6000; }
.tag-error { background: #ffe0e0; color: #c00; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px;
        font-size: 11px; font-weight: 600; }
.chip-ok { background: #e3f9ec; color: #1a7a3e; }
.chip-no { background: #ffeaea; color: #c00; }
.badge { display: inline-block; background: #e5e5ea; color: #3a3a3c;
         border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin-left: 4px; }
.badge.green { background: #e3f9ec; color: #1a7a3e; }
.badge.red   { background: #ffeaea; color: #c00; }

/* Colors */
.green { color: #1a7a3e; }
.red   { color: #c00; }

/* Buttons */
.btn-sync { background: #0071e3; color: #fff; border: none; border-radius: 8px;
            padding: 9px 20px; font-size: 14px; font-weight: 500; cursor: pointer;
            transition: background .15s; }
.btn-sync:hover:not(:disabled) { background: #0077ed; }
.btn-sync:disabled { background: #a0c4f0; cursor: not-allowed; }
.btn-export { background: #f5f5f7; border: 1px solid #d2d2d7; color: #1d1d1f;
              border-radius: 8px; padding: 8px 16px; text-decoration: none;
              font-size: 13px; font-weight: 500; }
.btn-export:hover { background: #e8e8ed; }
.export-buttons { display: flex; gap: 8px; }

/* Filters */
.filters { margin-bottom: 20px; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { text-decoration: none; padding: 7px 16px; border-radius: 8px; font-size: 13px;
       color: #3a3a3c; background: #fff; border: 1px solid #d2d2d7; transition: all .15s; }
.tab:hover { border-color: #0071e3; color: #0071e3; }
.tab.active { background: #0071e3; color: #fff; border-color: #0071e3; }
.tab.active .badge { background: rgba(255,255,255,.25); color: #fff; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-input { flex: 1; max-width: 420px; padding: 8px 14px; border: 1px solid #d2d2d7;
                border-radius: 8px; font-size: 14px; outline: none; }
.search-input:focus { border-color: #0071e3; }
.btn-search { background: #1d1d1f; color: #fff; border: none; border-radius: 8px;
              padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn-clear { color: #6e6e73; text-decoration: none; font-size: 18px; padding: 0 4px; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 20px;
              justify-content: center; }
.page-btn { text-decoration: none; padding: 7px 16px; border-radius: 8px;
            background: #fff; border: 1px solid #d2d2d7; font-size: 13px; color: #1d1d1f; }
.page-btn:hover { border-color: #0071e3; }
.page-info { color: #6e6e73; font-size: 13px; }

/* Clickable rows */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #eef4ff !important; }

/* Table footer */
.table-footer { padding: 12px 16px; background: #fff; border-top: 1px solid #f0f0f2;
                border-radius: 0 0 10px 10px; }
.link-all { font-size: 13px; color: #0071e3; text-decoration: none; font-weight: 500; }
.link-all:hover { text-decoration: underline; }

/* Result count */
.result-count { font-size: 13px; color: #6e6e73; margin-bottom: 12px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: #6e6e73;
               background: #fff; border-radius: 12px; margin-top: 16px; }

/* Section title */
h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; margin-top: 32px; }
h2:first-child { margin-top: 0; }

/* Auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-box { background: #fff; border-radius: 16px; padding: 40px 40px 36px;
            box-shadow: 0 4px 24px rgba(0,0,0,.10); width: 100%; max-width: 380px; }
.auth-logo { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-logo span { color: #6e6e73; }
.auth-sub { font-size: 13px; color: #6e6e73; margin-bottom: 28px; }
.auth-box label { display: block; font-size: 12px; font-weight: 500; color: #6e6e73;
                  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.auth-box input { width: 100%; padding: 10px 14px; border: 1px solid #d2d2d7;
                  border-radius: 8px; font-size: 15px; outline: none; margin-bottom: 16px; }
.auth-box input:focus { border-color: #0071e3; }
.auth-box button { width: 100%; background: #0071e3; color: #fff; border: none;
                   border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 500;
                   cursor: pointer; margin-top: 4px; }
.auth-box button:hover { background: #0077ed; }
.back-link { display: block; text-align: center; margin-top: 20px; font-size: 13px;
             color: #6e6e73; text-decoration: none; }
.back-link:hover { color: #0071e3; }
.alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fff0f0; color: #c00; border: 1px solid #ffd0d0; }
