/* المشجرة - مكونات عامة مشتركة */

body.ft-theme .wrap,
body.ft-theme .container,
body.ft-theme .page,
body.ft-theme .header-box,
body.ft-theme .card,
body.ft-theme .admin-card,
body.ft-theme .panel,
body.ft-theme .box,
body.ft-theme details.card{
    border-color:var(--ft-border) !important;
}

body.ft-theme .ft-card,
body.ft-theme .card,
body.ft-theme .admin-card,
body.ft-theme .header-box,
body.ft-theme .wrap,
body.ft-theme .container,
body.ft-theme details.card{
    background:var(--ft-card-bg) !important;
    box-shadow:var(--ft-shadow-soft);
}

body.ft-theme .topbar,
body.ft-theme .admin-topbar,
body.ft-theme .navbar,
body.ft-theme header.admin-header{
    background:linear-gradient(135deg, var(--ft-primary), var(--ft-primary-2)) !important;
    color:#fff !important;
}

body.ft-theme .topbar a,
body.ft-theme .admin-topbar a,
body.ft-theme .navbar a,
body.ft-theme header.admin-header a{
    color:#fff !important;
}

body.ft-theme h1,
body.ft-theme h2,
body.ft-theme h3,
body.ft-theme .page-title,
body.ft-theme .section-title{
    color:var(--ft-primary) !important;
}

body.ft-theme p,
body.ft-theme .hint,
body.ft-theme .muted,
body.ft-theme small{
    color:var(--ft-muted);
}

body.ft-theme input,
body.ft-theme select,
body.ft-theme textarea{
    background:#fff !important;
    color:var(--ft-text) !important;
    border:1px solid var(--ft-border) !important;
    border-radius:12px;
    outline:none;
}

body.ft-theme input:focus,
body.ft-theme select:focus,
body.ft-theme textarea:focus{
    border-color:var(--ft-accent) !important;
    box-shadow:0 0 0 3px color-mix(in srgb, var(--ft-accent-soft) 75%, transparent) !important;
}

body.ft-theme table{
    background:var(--ft-card-bg) !important;
    border-color:var(--ft-border) !important;
}

body.ft-theme th{
    background:var(--ft-primary) !important;
    color:#fff !important;
    border-color:color-mix(in srgb, var(--ft-primary) 78%, #fff) !important;
}

body.ft-theme td{
    border-color:var(--ft-border) !important;
}

body.ft-theme tr:nth-child(even){
    background:color-mix(in srgb, var(--ft-card-bg-soft) 72%, #fff) !important;
}

body.ft-theme .btn,
body.ft-theme button,
body.ft-theme input[type="submit"],
body.ft-theme input[type="button"]{
    border-radius:12px;
    font-family:inherit;
}

body.ft-theme .btn-primary,
body.ft-theme .primary,
body.ft-theme button[type="submit"],
body.ft-theme input[type="submit"]{
    background:var(--ft-primary) !important;
    border-color:var(--ft-primary) !important;
    color:#fff !important;
}

body.ft-theme .btn-primary:hover,
body.ft-theme .primary:hover,
body.ft-theme button[type="submit"]:hover,
body.ft-theme input[type="submit"]:hover{
    background:var(--ft-primary-2) !important;
}

body.ft-theme .btn-light,
body.ft-theme .btn-secondary,
body.ft-theme .secondary{
    background:var(--ft-primary-soft) !important;
    border-color:var(--ft-border) !important;
    color:var(--ft-primary) !important;
}

body.ft-theme .btn-danger,
body.ft-theme .danger,
body.ft-theme .delete,
body.ft-theme .btn-delete{
    background:var(--ft-danger) !important;
    border-color:var(--ft-danger) !important;
    color:#fff !important;
}

body.ft-theme .btn-danger:hover,
body.ft-theme .danger:hover,
body.ft-theme .delete:hover,
body.ft-theme .btn-delete:hover{
    background:var(--ft-danger-2) !important;
}

body.ft-theme .badge,
body.ft-theme .tag,
body.ft-theme .pill{
    background:var(--ft-primary-soft) !important;
    border:1px solid var(--ft-border) !important;
    color:var(--ft-primary) !important;
}

body.ft-theme .msg,
body.ft-theme .alert,
body.ft-theme .notice{
    border-radius:14px;
    border:1px solid var(--ft-border);
    background:var(--ft-card-bg-soft);
    color:var(--ft-text);
}

body.ft-theme .msg.success,
body.ft-theme .alert-success{
    background:var(--ft-success-soft) !important;
    border-color:color-mix(in srgb, var(--ft-success) 30%, #fff) !important;
    color:var(--ft-success) !important;
}

body.ft-theme .msg.error,
body.ft-theme .alert-danger,
body.ft-theme .alert-error{
    background:var(--ft-danger-soft) !important;
    border-color:color-mix(in srgb, var(--ft-danger) 28%, #fff) !important;
    color:var(--ft-danger) !important;
}

body.ft-theme .msg.warning,
body.ft-theme .alert-warning{
    background:var(--ft-warning-soft) !important;
    border-color:color-mix(in srgb, var(--ft-warning) 28%, #fff) !important;
    color:var(--ft-warning) !important;
}

/*
  توحيد أزرار الحذف والتحذير مركزيًا.
  أي زر يحمل أحد هذه الكلاسات أو رابط يحتوي delete/remove يظهر باللون الأحمر.
*/
html body.ft-theme a.btn-danger,
html body.ft-theme button.btn-danger,
html body.ft-theme input.btn-danger,
html body.ft-theme a.danger,
html body.ft-theme button.danger,
html body.ft-theme input.danger,
html body.ft-theme a.delete,
html body.ft-theme button.delete,
html body.ft-theme input.delete,
html body.ft-theme a.btn-delete,
html body.ft-theme button.btn-delete,
html body.ft-theme input.btn-delete,
html body.ft-theme a.delete-btn,
html body.ft-theme button.delete-btn,
html body.ft-theme input.delete-btn,
html body.ft-theme a.action-delete,
html body.ft-theme button.action-delete,
html body.ft-theme a[href*="delete"],
html body.ft-theme a[href*="remove"],
html body.ft-theme button[name*="delete"],
html body.ft-theme button[value*="delete"]{
    background:var(--ft-danger) !important;
    border:1px solid var(--ft-danger) !important;
    color:#fff !important;
    box-shadow:0 8px 18px color-mix(in srgb, var(--ft-danger) 18%, transparent) !important;
}

html body.ft-theme a.btn-danger:hover,
html body.ft-theme button.btn-danger:hover,
html body.ft-theme input.btn-danger:hover,
html body.ft-theme a.danger:hover,
html body.ft-theme button.danger:hover,
html body.ft-theme input.danger:hover,
html body.ft-theme a.delete:hover,
html body.ft-theme button.delete:hover,
html body.ft-theme input.delete:hover,
html body.ft-theme a.btn-delete:hover,
html body.ft-theme button.btn-delete:hover,
html body.ft-theme input.btn-delete:hover,
html body.ft-theme a.delete-btn:hover,
html body.ft-theme button.delete-btn:hover,
html body.ft-theme input.delete-btn:hover,
html body.ft-theme a.action-delete:hover,
html body.ft-theme button.action-delete:hover,
html body.ft-theme a[href*="delete"]:hover,
html body.ft-theme a[href*="remove"]:hover,
html body.ft-theme button[name*="delete"]:hover,
html body.ft-theme button[value*="delete"]:hover{
    background:var(--ft-danger-2) !important;
    border-color:var(--ft-danger-2) !important;
    color:#fff !important;
}

html body.ft-theme a.btn-danger::before,
html body.ft-theme a.danger::before,
html body.ft-theme a.delete::before,
html body.ft-theme a.btn-delete::before,
html body.ft-theme a.delete-btn::before,
html body.ft-theme a.action-delete::before,
html body.ft-theme a[href*="delete"]::before,
html body.ft-theme a[href*="remove"]::before{
    content:"🗑 ";
    font-size:.95em;
}

html body.ft-theme .actions,
html body.ft-theme .node-actions,
html body.ft-theme .form-actions,
html body.ft-theme .row-actions,
html body.ft-theme .table-actions{
    gap:8px;
}
