/* ============================================================
   KURA — Components
   kura-components.css — v1.0
   All shared UI components. No page-specific layout here.
   ============================================================ */

/* ============================================================
   SIDEBAR (desktop only)
   ============================================================ */
.kura-sidebar {
    position:   fixed;
    top:        0;
    left:       0;
    width:      var(--sidebar-w);
    height:     100vh;
    background: var(--surface);
    border-right: 1px solid var(--div);
    display:    flex;
    flex-direction: column;
    align-items: center;
    padding:    var(--sp-5) 0;
    z-index:    100;
    gap:        var(--sp-1);
}

.kura-sidebar__logo {
    font-family:    var(--font-display);
    font-size:      20px;
    font-weight:    400;
    text-transform: uppercase;
    color:          var(--ink);
    letter-spacing: 0.05em;
    margin-bottom:  var(--sp-5);
    line-height:    1;
}

.kura-sidebar__logo span {
    color: var(--accent);
}

.kura-nav-item {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            3px;
    padding:        var(--sp-2) var(--sp-2);
    width:          100%;
    cursor:         pointer;
    color:          var(--ink3);
    transition:     color 0.15s ease;
    text-decoration: none;
}

.kura-nav-item:hover {
    color: var(--ink2);
}

.kura-nav-item.active {
    color: var(--ink);
}

.kura-nav-item.active .kura-nav-item__icon {
    color: var(--accent);
}

.kura-nav-item__icon {
    font-size: 16px;
    line-height: 1;
}

.kura-nav-item__label {
    font-family:    var(--font-body);
    font-size:      var(--t-label);
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align:     center;
}

.kura-sidebar__spacer { flex: 1; }

/* ============================================================
   BOTTOM NAV (mobile only)
   ============================================================ */
.kura-bottom-nav {
    display:    none;
    position:   fixed;
    bottom:     0;
    left:       0;
    right:      0;
    height:     56px;
    background: var(--surface);
    border-top: 1px solid var(--div);
    z-index:    100;
    flex-direction: row;
    align-items: stretch;
}

.kura-bottom-nav .kura-nav-item {
    flex: 1;
    padding: var(--sp-2) var(--sp-1);
    gap: 2px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.kura-page-header {
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    padding:        var(--sp-5) var(--sp-6);
    border-bottom:  1px solid var(--div);
    background:     var(--bg);
    min-height:     64px;
}

.kura-page-header__back {
    font-size:      var(--t-body);
    color:          var(--ink3);
    display:        flex;
    align-items:    center;
    gap:            var(--sp-1);
    min-width:      80px;
    text-decoration: none;
    transition:     color 0.15s ease;
}

.kura-page-header__back:hover { color: var(--ink2); }

.kura-page-header__title {
    font-family:    var(--font-display);
    font-size:      var(--t-l2);
    font-weight:    400;
    text-transform: uppercase;
    color:          var(--ink);
    line-height:    1;
    letter-spacing: 0.01em;
    flex: 1;
    text-align:     center;
}

.kura-page-header__actions {
    display:    flex;
    align-items: center;
    gap:        var(--sp-2);
    min-width:  80px;
    justify-content: flex-end;
}

/* ============================================================
   CONTENT SHELL
   ============================================================ */
.kura-content-shell {
    width:   min(1200px, 100%);
    margin:  0 auto;
    padding: var(--sp-6);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.vita-btn {
    display:        inline-flex;
    align-items:    center;
    justify-content: center;
    gap:            var(--sp-2);
    padding:        0 var(--sp-4);
    height:         32px;
    font-family:    var(--font-body);
    font-size:      var(--t-body);
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor:         pointer;
    border:         1px solid var(--div);
    border-radius:  0;
    background:     var(--surface);
    color:          var(--ink2);
    box-shadow:     0 1px 2px rgba(15,15,14,.04);
    transition:     background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space:    nowrap;
    text-decoration: none;
    line-height:    1;
}

.vita-btn:hover {
    background: var(--s1);
}

.vita-btn.primary {
    background:   var(--accent);
    color:        #fff;
    border-color: var(--accent);
    box-shadow:   none;
}

.vita-btn.primary:hover {
    background:   #cf3a0e;
    border-color: #cf3a0e;
}

.vita-btn.outline-accent {
    background:   transparent;
    color:        var(--accent);
    border-color: var(--accent);
    box-shadow:   none;
}

.vita-btn.outline-accent:hover {
    background: rgba(232,64,16,.06);
}

.vita-btn.ghost {
    background:   transparent;
    border-color: transparent;
    box-shadow:   none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vita-btn.ghost:hover {
    background: var(--s1);
    text-decoration: none;
}

.vita-btn.outline-danger {
    background:   transparent;
    color:        #c0392b;
    border-color: rgba(192,57,43,.3);
    box-shadow:   none;
}

.vita-btn.outline-danger:hover {
    background: rgba(192,57,43,.05);
}

.vita-btn:disabled,
.vita-btn[disabled] {
    opacity: 0.4;
    cursor:  not-allowed;
    pointer-events: none;
}

/* FAB */
.kura-fab {
    position:      fixed;
    bottom:        var(--sp-6);
    right:         var(--sp-6);
    width:         48px;
    height:        48px;
    border-radius: 50%;
    background:    var(--surface);
    border:        1px solid var(--div);
    box-shadow:    0 4px 16px rgba(15,15,14,.12);
    display:       flex;
    align-items:   center;
    justify-content: center;
    font-size:     20px;
    cursor:        pointer;
    color:         var(--ink2);
    z-index:       90;
    transition:    box-shadow 0.15s ease;
}

.kura-fab::after {
    content:       '';
    position:      absolute;
    top:           2px;
    right:         2px;
    width:         8px;
    height:        8px;
    border-radius: 50%;
    background:    var(--accent);
}

.kura-fab:hover {
    box-shadow: 0 6px 24px rgba(15,15,14,.18);
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.kura-field {
    display:        flex;
    flex-direction: column;
    gap:            var(--sp-1);
}

.kura-field + .kura-field { margin-top: var(--sp-4); }

.kura-field__label {
    font-family:    var(--font-body);
    font-size:      var(--t-label);
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          var(--ink3);
}

.cal-vita-input,
.cal-vita-select,
.cal-vita-textarea {
    width:        100%;
    background:   var(--s1);
    border:       1px solid rgba(15,15,14,.1);
    border-radius: 0;
    padding:      var(--sp-2) var(--sp-3);
    font-family:  var(--font-body);
    font-size:    var(--t-body);
    font-weight:  400;
    color:        var(--ink);
    outline:      none;
    transition:   border-color 0.15s ease;
    appearance:   none;
    -webkit-appearance: none;
}

.cal-vita-input::placeholder,
.cal-vita-textarea::placeholder {
    color: var(--ink3);
}

.cal-vita-input:focus,
.cal-vita-select:focus,
.cal-vita-textarea:focus {
    border-color: var(--ink2);
    background:   #fff;
}

.cal-vita-textarea {
    resize:     vertical;
    min-height: 80px;
    line-height: 1.6;
}

.cal-vita-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A8A49A'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-3) center;
    padding-right: var(--sp-6);
    cursor: pointer;
}

/* ============================================================
   DRAWER (C23 standard — right-side contained panel)
   ============================================================ */
.kura-drawer-shell {
    position: relative;
    overflow: hidden; /* contains the drawer */
}

.kura-drawer {
    position:   absolute;
    top:        0;
    right:      0;
    width:      420px;
    height:     100%;
    background: var(--surface);
    z-index:    50;
    display:    flex;
    flex-direction: column;
    transform:  translateX(100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kura-drawer.open {
    transform:  translateX(0);
    box-shadow: -4px 0 24px rgba(15,15,14,.06);
}

.kura-drawer__head {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    padding:     var(--sp-5) var(--sp-5) var(--sp-4);
    border-bottom: 1px solid var(--div);
    flex-shrink: 0;
}

.kura-drawer__title {
    font-family:    var(--font-display);
    font-size:      20px;
    font-weight:    400;
    text-transform: uppercase;
    color:          var(--ink);
    line-height:    1;
}

.kura-drawer__close {
    background:  transparent;
    border:      none;
    cursor:      pointer;
    color:       var(--ink3);
    font-size:   18px;
    padding:     var(--sp-1);
    transition:  color 0.15s ease;
    line-height: 1;
}

.kura-drawer__close:hover { color: var(--ink); }

.kura-drawer__body {
    flex:       1;
    overflow-y: auto;
    padding:    var(--sp-5);
}

.kura-drawer__foot {
    padding:      var(--sp-4) var(--sp-5);
    border-top:   1px solid var(--div);
    display:      flex;
    gap:          var(--sp-2);
    justify-content: flex-end;
    flex-shrink:  0;
}

/* ============================================================
   BADGES
   ============================================================ */
.kura-badge {
    display:       inline-flex;
    align-items:   center;
    padding:       2px var(--sp-2);
    border-radius: 100px; /* pill */
    font-family:   var(--font-body);
    font-size:     var(--t-label);
    font-weight:   500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space:   nowrap;
}

.kura-badge--accent  { background: var(--accent); color: #fff; }
.kura-badge--neutral { background: var(--s2);     color: var(--ink2); }
.kura-badge--ghost   { background: transparent;   color: var(--ink3); border: 1px solid var(--div); }

/* Count badge (number indicator) */
.kura-count {
    display:       inline-flex;
    align-items:   center;
    justify-content: center;
    min-width:     16px;
    height:        16px;
    border-radius: 50%;
    background:    var(--accent);
    color:         #fff;
    font-family:   var(--font-body);
    font-size:     var(--t-label);
    font-weight:   500;
    padding:       0 4px;
}

/* ============================================================
   CARDS / ROWS
   ============================================================ */
.kura-card {
    background:   var(--surface);
    border:       1px solid var(--div);
    padding:      var(--sp-4) var(--sp-5);
}

.kura-card + .kura-card { border-top: none; }

.kura-row {
    display:     flex;
    align-items: center;
    gap:         var(--sp-3);
    padding:     var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--div);
    transition:  background 0.1s ease;
}

.kura-row:hover { background: var(--s1); }

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

.kura-row__main {
    flex: 1;
    min-width: 0;
}

.kura-row__title {
    font-size:   var(--t-body);
    font-weight: 500;
    color:       var(--ink);
    white-space: nowrap;
    overflow:    hidden;
    text-overflow: ellipsis;
}

.kura-row__meta {
    font-size:  var(--t-meta);
    color:      var(--ink3);
    margin-top: 2px;
}

/* ============================================================
   SECTION HEADS
   ============================================================ */
.kura-section-head {
    font-family:    var(--font-body);
    font-size:      var(--t-label);
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          var(--ink3);
    padding:        var(--sp-3) 0 var(--sp-2);
    border-bottom:  1px solid var(--div);
    margin-bottom:  var(--sp-2);
}

/* ============================================================
   MODALS
   ============================================================ */
.kura-modal-overlay {
    position:   fixed;
    inset:      0;
    background: rgba(15,15,14,.3);
    z-index:    200;
    display:    flex;
    align-items: center;
    justify-content: center;
    padding:    var(--sp-5);
    opacity:    0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.kura-modal-overlay.open {
    opacity:        1;
    pointer-events: all;
}

.kura-modal {
    background: var(--surface);
    width:      min(480px, 100%);
    max-height: 80vh;
    display:    flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(15,15,14,.12);
}

.kura-modal__head {
    padding:       var(--sp-5);
    border-bottom: 1px solid var(--div);
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    flex-shrink:   0;
}

.kura-modal__title {
    font-family:    var(--font-display);
    font-size:      20px;
    font-weight:    400;
    text-transform: uppercase;
    color:          var(--ink);
    line-height:    1;
}

.kura-modal__body {
    padding:    var(--sp-5);
    overflow-y: auto;
    flex:       1;
}

.kura-modal__foot {
    padding:    var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--div);
    display:    flex;
    gap:        var(--sp-2);
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ============================================================
   CONFIRM DIALOG (delete, destructive actions)
   ============================================================ */
.kura-confirm {
    background: var(--surface);
    width:      min(360px, 100%);
    box-shadow: 0 16px 48px rgba(15,15,14,.12);
    padding:    var(--sp-6);
    display:    flex;
    flex-direction: column;
    gap:        var(--sp-5);
}

.kura-confirm__message {
    font-size:   var(--t-body);
    color:       var(--ink2);
    line-height: 1.6;
}

.kura-confirm__actions {
    display:         flex;
    gap:             var(--sp-2);
    justify-content: flex-end;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#kura-toast-container {
    position:      fixed;
    bottom:        var(--sp-6);
    left:          50%;
    transform:     translateX(-50%);
    z-index:       999;
    display:       flex;
    flex-direction: column;
    gap:           var(--sp-2);
    align-items:   center;
    pointer-events: none;
}

.kura-toast {
    background:   var(--ink);
    color:        #fff;
    font-size:    var(--t-body);
    font-weight:  400;
    padding:      var(--sp-2) var(--sp-5);
    box-shadow:   0 4px 16px rgba(15,15,14,.2);
    opacity:      0;
    transform:    translateY(8px);
    transition:   opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space:  nowrap;
}

.kura-toast.show {
    opacity:   1;
    transform: translateY(0);
}

.kura-toast.success { background: #2d6a4f; }
.kura-toast.error   { background: var(--accent); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.kura-empty {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    justify-content: center;
    gap:            var(--sp-3);
    padding:        var(--sp-8) var(--sp-6);
    color:          var(--ink3);
    text-align:     center;
}

.kura-empty__symbol { font-size: 24px; }

.kura-empty__label {
    font-size:      var(--t-body);
    color:          var(--ink3);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.kura-divider {
    height:     1px;
    background: var(--div);
    margin:     var(--sp-5) 0;
}

/* ============================================================
   MOBILE OVERRIDES
   ============================================================ */
@media (max-width: 768px) {
    .kura-sidebar    { display: none; }
    .kura-bottom-nav { display: flex; }

    .kura-drawer {
        position: fixed;
        bottom:   0;
        left:     0;
        right:    0;
        top:      auto;
        width:    100%;
        height:   85vh;
        transform: translateY(100%);
        border-radius: 0;
    }

    .kura-drawer.open {
        transform: translateY(0);
        box-shadow: 0 -4px 24px rgba(15,15,14,.1);
    }

    .kura-fab {
        bottom: calc(56px + var(--sp-4)); /* above bottom nav */
    }

    .kura-page-header {
        padding: var(--sp-3) var(--sp-4);
    }

    .kura-content-shell {
        padding: var(--sp-4);
    }
}
