/* Components: header, sidebar, footer, nav */
/* Header */
.c-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.8); backdrop-filter: blur(8px); }
.c-header__bar { height: 0.25rem; width: 100%; background-image: linear-gradient(90deg, var(--brand-dark), var(--brand-accent), var(--brand-dark)); }
.c-header__inner { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) { .c-header__inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .c-header__inner { padding-left: 2rem; padding-right: 2rem; } }
.c-header__row { display: flex; height: 4rem; align-items: center; justify-content: space-between; }
.c-header__brand { display: flex; align-items: center; gap: 0.75rem; color: var(--brand-dark); font-weight: 600; }

/* Sidebar */
.c-sidebar { z-index: 50; }
.c-sidebar__surface { height: 100%; background: var(--brand-dark); color: #fff; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); border-right: 1px solid rgba(0,0,0,0.2); display: flex; flex-direction: column; }
.c-sidebar__brand { height: 4rem; display: flex; align-items: center; gap: 0.75rem; padding: 0 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.c-sidebar__nav { padding: 0.75rem; flex: 1 1 auto; }
.c-nav__item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 0.5rem; color: rgba(255,255,255,0.9); transition: background 150ms ease, color 150ms ease; }
.c-nav__item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.c-nav__item--active { background: rgba(255,255,255,0.1); color: #fff; }
.c-sidebar__collapsed-hint { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.75rem; color: rgba(255,255,255,0.6); }

/* Footer */
.c-footer { margin-top: auto; background: rgba(255,255,255,0.8); backdrop-filter: blur(8px); border-top: 1px solid rgba(0,0,0,0.08); }
.c-footer__bar { height: 0.25rem; width: 100%; background-image: linear-gradient(90deg, var(--brand-dark), var(--brand-accent), var(--brand-dark)); }
.c-footer__inner { padding-left: 1rem; padding-right: 1rem; padding-top: 1rem; padding-bottom: 1rem; display: flex; align-items: center; justify-content: center !important; text-align: center; font-size: 0.875rem; color: #4b5563; }
.c-footer__inner > * { margin-left: auto; margin-right: auto; }
@media (min-width: 640px) { .c-footer__inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .c-footer__inner { padding-left: 2rem; padding-right: 2rem; } }

/* Section container */
.c-section { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 0.75rem; overflow: hidden; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.04); }
.c-section__header { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between; }
.c-section__title { font-size: 1.125rem; font-weight: 600; color: var(--brand-dark); }
.c-section__body { padding: 1.5rem; }

/* Table */
.c-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.c-table thead th { text-align: left; font-weight: 600; color: #374151; background: #f9fafb; border-bottom: 1px solid #e5e7eb; padding: 0.75rem 1rem; }
.c-table tbody td { border-bottom: 1px solid #f3f4f6; padding: 0.75rem 1rem; color: #374151; }
.c-table tbody tr:hover { background: #fafafa; }

/* Form Row */
.c-form-row { display: grid; gap: 0.375rem; }
@media (min-width: 640px) { .c-form-row { grid-template-columns: 12rem 1fr; align-items: center; } }
.c-form-row label { font-size: 0.875rem; color: #374151; }

/* Empty State */
.c-empty { text-align: center; padding: 2.5rem 1rem; color: #6b7280; }
.c-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 9999px; background: #f3f4f6; color: var(--brand-dark); margin-bottom: 0.5rem; }
.c-empty__title { font-weight: 600; color: var(--brand-dark); }

/* Alerts */
.c-alert { border-radius: 0.75rem; border: 1px solid; padding: 0.75rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start; }
.c-alert__icon { flex: none; margin-top: 0.125rem; }
.c-alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.c-alert--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.c-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.c-alert--danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Tabs */
.c-tabs { display: flex; border-bottom: 1px solid #e5e7eb; gap: 1rem; }
.c-tab { position: relative; padding: 0.75rem 0.25rem; color: #6b7280; font-weight: 500; }
.c-tab:hover { color: #374151; }
.c-tab--active { color: var(--brand-dark); }
.c-tab--active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--brand-dark), var(--brand-accent)); border-radius: 2px; }

/* Modal */
.c-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); }
.c-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.c-modal__panel { width: 100%; max-width: 32rem; background: #fff; border-radius: 0.75rem; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); overflow: hidden; }
.c-modal__header { padding: 1rem 1.25rem; border-bottom: 1px solid #f3f4f6; font-weight: 600; color: var(--brand-dark); display: flex; align-items: center; justify-content: space-between; }
.c-modal__body { padding: 1.25rem; color: #374151; }
.c-modal__footer { padding: 1rem 1.25rem; border-top: 1px solid #f3f4f6; display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Breadcrumbs */
.c-breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: #6b7280; font-size: 0.875rem; }
.c-breadcrumbs a { color: var(--brand-dark); }
.c-breadcrumbs__sep { color: #9ca3af; }

/* Pagination */
.c-pagination { display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; background: #fff; padding: 0.25rem; }
.c-page { min-width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem; color: #374151; }
.c-page:hover { background: #f3f4f6; }
.c-page--active { background: color-mix(in srgb, var(--brand-accent) 18%, white); color: var(--brand-dark); font-weight: 600; }

/* Dropdown */
.c-dropdown { position: relative; display: inline-block; }
.c-dropdown__btn { }
.c-dropdown__menu { position: absolute; right: 0; margin-top: 0.5rem; min-width: 12rem; background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); overflow: hidden; }
.c-dropdown__item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; color: #374151; }
.c-dropdown__item:hover { background: #f9fafb; }

/* Cards and grids */
.c-card { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 0.75rem; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.04); transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease; }
.c-card--hover:hover { box-shadow: 0 10px 20px -5px rgba(0,0,0,0.15), 0 4px 6px -2px rgba(0,0,0,0.1); transform: translateY(-2px); }
.c-card--tilt { will-change: transform; transform-style: preserve-3d; }
.c-card__body { padding: 1rem; }
.c-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .c-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .c-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Icon circle */
.c-icon-circle { width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.c-icon-circle.is-accent { background: color-mix(in srgb, var(--brand-accent) 18%, white); color: var(--brand-dark); }
.c-icon-circle.is-gray { background: #f3f4f6; color: #374151; }
.c-icon-circle.is-green { background: #ecfdf5; color: #065f46; }
