*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:    #4f46e5;
    --color-primary-h:  #4338ca;
    --color-danger:     #dc2626;
    --color-text:       #111827;
    --color-muted:      #6b7280;
    --color-border:     #e5e7eb;
    --color-bg:         #f9fafb;
    --color-white:      #ffffff;
    --radius:           8px;
    --shadow:           0 1px 3px rgba(0,0,0,.1);
}

body { font-family: system-ui, sans-serif; color: var(--color-text);
       background: var(--color-bg); line-height: 1.5; }

/* Layout */
.container { max-width: 860px; margin: 0 auto; padding: 2rem 1rem; }

/* Navbar */
.navbar { background: var(--color-white); border-bottom: 1px solid var(--color-border);
          padding: .75rem 1.5rem; display: flex; align-items: center;
          justify-content: space-between; }
.navbar__brand { font-weight: 700; font-size: 1.1rem; color: var(--color-primary);
                 text-decoration: none; }
.navbar__menu { display: flex; align-items: center; gap: 1rem; }
.navbar__menu a { color: var(--color-text); text-decoration: none; font-size: .9rem; }

/* Botones */
.btn { display: inline-block; padding: .5rem 1rem; border-radius: var(--radius);
       font-size: .875rem; font-weight: 500; cursor: pointer; border: none;
       text-decoration: none; transition: background .15s; }
.btn--primary  { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-h); }
.btn--secondary { background: var(--color-white); color: var(--color-text);
                  border: 1px solid var(--color-border); }
.btn--danger   { background: var(--color-danger); color: #fff; }
.btn--ghost    { background: transparent; color: var(--color-muted); }
.btn--sm       { padding: .25rem .6rem; font-size: .8rem; }
.btn--full     { width: 100%; text-align: center; }

/* Formularios */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500;
                    margin-bottom: .3rem; }
.form-group input, .form-group textarea {
    width: 100%; padding: .5rem .75rem; border: 1px solid var(--color-border);
    border-radius: var(--radius); font-size: .9rem; background: var(--color-white); }
.form-group input:focus { outline: none; border-color: var(--color-primary); }
.form-group small { color: var(--color-muted); font-size: .8rem; }
.form-row { display: flex; gap: 1rem; }
.form-group--grow { flex: 1; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center;
             min-height: 100vh; }
.auth-card { background: var(--color-white); border: 1px solid var(--color-border);
             border-radius: var(--radius); padding: 2rem; width: 100%;
             max-width: 400px; box-shadow: var(--shadow); }
.auth-card__title { font-size: 1.5rem; font-weight: 700; color: var(--color-primary);
                    text-align: center; margin-bottom: .25rem; }
.auth-card__subtitle { color: var(--color-muted); text-align: center;
                       margin-bottom: 1.5rem; font-size: .9rem; }
.auth-card__footer { text-align: center; margin-top: 1rem;
                     font-size: .875rem; color: var(--color-muted); }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: var(--radius);
         margin-bottom: 1rem; font-size: .875rem; }
.flash--error   { background: #fef2f2; color: #991b1b;
                  border: 1px solid #fecaca; }
.flash--success { background: #f0fdf4; color: #166534;
                  border: 1px solid #bbf7d0; }

/* Page header */
.page-header { display: flex; align-items: flex-start;
               justify-content: space-between; margin-bottom: 2rem; gap: 1rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header__actions { display: flex; gap: .5rem; }

/* Collections grid */
.collections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
                    gap: 1rem; }
.collection-card { background: var(--color-white); border: 1px solid var(--color-border);
                   border-radius: var(--radius); padding: 1.25rem;
                   text-decoration: none; color: inherit; box-shadow: var(--shadow);
                   transition: box-shadow .15s; }
.collection-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.collection-card__header { display: flex; justify-content: space-between;
                           align-items: flex-start; margin-bottom: .5rem; }
.collection-card__header h2 { font-size: 1rem; font-weight: 600; }
.collection-card__desc { font-size: .875rem; color: var(--color-muted);
                         margin-bottom: .75rem; }
.collection-card__footer { font-size: .8rem; color: var(--color-muted);
                            display: flex; justify-content: space-between; }

/* Links list */
.links-list { display: flex; flex-direction: column; gap: .5rem; }
.link-item { background: var(--color-white); border: 1px solid var(--color-border);
             border-radius: var(--radius); padding: .75rem 1rem;
             display: flex; align-items: center; gap: .75rem; }
.link-item__favicon { width: 16px; flex-shrink: 0; }
.link-item__content { flex: 1; min-width: 0; }
.link-item__title { font-size: .9rem; font-weight: 500; color: var(--color-primary);
                    text-decoration: none; display: block;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-item__url { font-size: .8rem; color: var(--color-muted);
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                  display: block; }
.link-item__tags { display: flex; gap: .3rem; margin-top: .3rem; flex-wrap: wrap; }

/* Badges y tags */
.badge { font-size: .7rem; padding: .15rem .5rem; border-radius: 999px;
         font-weight: 500; }
.badge--public { background: #dbeafe; color: #1e40af; }
.tag { font-size: .75rem; background: var(--color-bg); border: 1px solid var(--color-border);
       padding: .15rem .5rem; border-radius: 999px; color: var(--color-muted); }

/* Sharing panel */
.sharing-panel { background: var(--color-white); border: 1px solid var(--color-border);
                 border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; }
.sharing-panel__active { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sharing-panel__active input { flex: 1; min-width: 200px; font-size: .8rem;
                                color: var(--color-muted); }

/* Add link form */
.add-link-form { background: var(--color-white); border: 1px solid var(--color-border);
                 border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.add-link-form h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-muted); }
.empty-state p { margin-bottom: 1rem; }