body{font-family:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;background:#fafafa;color:#222;margin:0;padding:0}
.container{max-width:760px;margin:24px auto;padding:0 16px}
form{display:flex;flex-direction:column;gap:12px}
input[type=text],input[type=password],input[type=email],input[type=url],select,textarea{padding:10px;border:1px solid #ccc;border-radius:10px;width:100%;box-sizing:border-box;background:#fff;transition:background .2s, border-color .2s, box-shadow .2s}
button, .btn{padding:10px 14px;border:none;background:#0a7cff;color:#fff;border-radius:10px;cursor:pointer;transition:transform .06s ease, box-shadow .2s ease, background .2s ease}
button:active, .btn:active{transform:translateY(1px)}
.btn-secondary{background:#6b7280}
a, .link{color:#0a7cff;text-decoration:none}
.row{display:flex;gap:8px;align-items:center}
.checkbox{display:flex;align-items:center;gap:6px}
.error{color:#b00020}
.success{color:#0a7c20}
.info{color:#333}


/* Alerts */
.alert{padding:12px 14px;border-radius:12px;border:1px solid transparent;margin:0 0 12px 0}
.alert-error{border-color:#f3c8ce;background:#fde8ea;color:#8b1a2b}
.alert-success{border-color:#c7ead2;background:#e8fbef;color:#126b3a}
.alert-info{border-color:#d5e4fb;background:#eef6ff;color:#0b57d0}

/* Card wrapper for forms */
.card{background:#fff;border:1px solid #e6e6e6;border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.06);padding:18px}
.card-title{margin:0 0 12px 0}
.confirm-card{max-width:540px;margin:0 auto}

/* Forms */
.form .form-group{display:flex;flex-direction:column;gap:6px}
.form.inline{display:block}
.actions-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.mt-2{margin-top:12px}
.muted{color:#666}
.divider{height:1px;background:#eee;margin:12px 0}

/* Layout */
.app-header{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;background:#fff;border-bottom:1px solid #e6e6e6;position:sticky;top:0;z-index:10}
.header-left{display:flex;align-items:center;gap:16px}
.header-right{display:flex;align-items:center;gap:12px}
.service-title{font-weight:700;letter-spacing:.3px;display:inline-flex;align-items:center;gap:10px;padding:4px 12px;border:1px solid rgba(10,124,255,.4);border-radius:14px;position:relative}
.service-title::before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;background:#e53935;box-shadow:0 0 0 2px rgba(229,57,53,.25), 0 0 10px rgba(229,57,53,.5)}
.layout{display:flex;min-height:calc(100vh - 52px)}
.sidebar{width:260px;background:#ffffff;border-right:1px solid #e6e6e6;padding:16px;box-sizing:border-box}
.content{flex:1;padding:16px;box-sizing:border-box}
.menu-section{font-size:12px;text-transform:uppercase;color:#888;margin-top:16px;margin-bottom:6px;letter-spacing:.8px}
.menu-tree{list-style:none;padding-left:12px;margin:0}
.menu-tree > li{margin:6px 0}
.menu-tree a{color:#222}
.menu-tree a.active{color:#0a7cff;font-weight:600}
.menu-tree ul{list-style:none;margin:6px 0 0 16px;padding:0}
 
/* Project select tweaks */
.project-select{display:flex;align-items:center;gap:8px}
 
/* Simple dropdown */
.dropdown{position:relative}
.dropdown-menu{display:none;position:absolute;right:0;top:calc(100% + 6px);background:#fff;border:1px solid #e6e6e6;border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.12);min-width:180px;overflow:hidden;z-index:100}
.dropdown.open .dropdown-menu{display:block}
.dropdown-menu a{display:block;padding:10px 12px;color:#222}
.dropdown-menu a:hover{background:#f5f5f5}

/* Icon buttons */
.icon-btn{line-height: 1; display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;border:none;background:#e9ecef;color:#222;cursor:pointer;text-decoration:none;transition:background .2s, box-shadow .2s, transform .06s}
.icon-btn:hover{background:#e3e7eb;box-shadow:0 6px 16px rgba(0,0,0,.08)}
.icon-btn:active{transform:translateY(1px)}
.icon-btn svg{width:20px;height:20px;display:block;flex:0 0 auto}
.btn-green{background:#16a34a;color:#fff}
.btn-green:hover{background:#15803d}
.avatar-btn{background:#e9ecef}
.avatar-btn:hover{background:#dfe3e7}

/* Specific square new-project icon button */
.new-project-btn{border-radius:6px}

/* Larger icon sizes for special icon buttons */
.profile-btn svg{width:28px;height:28px;min-width:20px;min-height:20px;flex:0 0 auto;aspect-ratio:1/1}
.new-project-btn svg{width:28px;height:28px}

/* Brighter profile button in dark theme will be styled under theme-portal */

/* =====================
   Luxury Hi‑Tech Dark Theme (scoped)
   Apply by setting <body class="theme-portal">
   ===================== */
body.theme-portal{background:radial-gradient(1200px 600px at 20% -10%, rgba(88,102,135,.12), transparent), radial-gradient(1000px 500px at 120% 10%, rgba(118,91,191,.12), transparent), #0c0f14;color:#e6eaf2}
body.theme-portal a, body.theme-portal .link{color:#86c5ff}
body.theme-portal .muted{color:#9aa3b2}

body.theme-portal .app-header{background:rgba(18,22,29,.7);backdrop-filter:blur(10px);border-bottom:1px solid rgba(120,137,170,.18)}
body.theme-portal .service-title{color:#e9eef7;border-color:rgba(134,197,255,.7);box-shadow:inset 0 0 0 1px rgba(134,197,255,.25), 0 0 12px rgba(134,197,255,.15)}

body.theme-portal .sidebar{background:rgba(14,17,23,.7);border-right:1px solid rgba(120,137,170,.18)}
body.theme-portal .content{background:transparent}
body.theme-portal .menu-section{color:#8390a3}
body.theme-portal .menu-tree a{color:#dbe4f3}
body.theme-portal .menu-tree a:hover{color:#ffffff}
body.theme-portal .menu-tree a.active{color:#ffffff;font-weight:600}

/* Cards */
body.theme-portal .card{background:linear-gradient(180deg, rgba(21,26,34,.92), rgba(17,21,28,.92));border:1px solid rgba(120,137,170,.18);box-shadow:0 10px 30px rgba(0,0,0,.35);color:#e6eaf2}
body.theme-portal .card-title{color:#f1f4fb}

/* Forms */
body.theme-portal input[type=text],
body.theme-portal input[type=password],
body.theme-portal input[type=email],
body.theme-portal input[type=url],
body.theme-portal select,
body.theme-portal textarea{background:#10151c;border:1px solid rgba(120,137,170,.24);color:#e6eaf2}
body.theme-portal input::placeholder, body.theme-portal select::placeholder{color:#8a95a6}
body.theme-portal input:focus, body.theme-portal select:focus{outline:none;border-color:#6aa7ff;box-shadow:0 0 0 4px rgba(80,140,255,.15)}
body.theme-portal .checkbox input{accent-color:#6aa7ff}

/* Buttons */
body.theme-portal button, body.theme-portal .btn{background:linear-gradient(135deg, #3a7bd5, #3a6073);color:#f7fbff;box-shadow:0 8px 20px rgba(58,123,213,.25);border-radius:12px}
body.theme-portal button:hover, body.theme-portal .btn:hover{filter:brightness(1.05);box-shadow:0 10px 28px rgba(58,123,213,.35)}
body.theme-portal .btn-secondary{background:linear-gradient(135deg, #4b5563, #374151)}
body.theme-portal .icon-btn{background:rgba(30,36,46,.9);color:#d7e3f6;border:1px solid rgba(120,137,170,.2)}
body.theme-portal .icon-btn:hover{background:rgba(38,45,58,.95);box-shadow:0 12px 32px rgba(0,0,0,.35)}
body.theme-portal .btn-green{background:linear-gradient(135deg, #16a34a, #0e7a36)}

/* Square new-project button in dark theme */
body.theme-portal .new-project-btn{border-radius:6px;border-color: rgba(95, 255, 173, 0.6);background:linear-gradient(135deg, rgba(83, 218, 140, 0.9), rgba(22,60,40,.9));color:#bff5d7}
body.theme-portal .new-project-btn:hover{filter:brightness(1.08);box-shadow:0 10px 28px rgba(50,150,110,.35)}

/* Brighter profile button */
body.theme-portal .profile-btn{color:#a7d1ff;border-color:rgba(110,160,255,.45);box-shadow:inset 0 0 0 1px rgba(110,160,255,.25), 0 0 16px rgba(110,160,255,.18)}
body.theme-portal .profile-btn:hover{color:#cfe6ff;box-shadow:inset 0 0 0 1px rgba(110,160,255,.3), 0 0 22px rgba(110,160,255,.28)}

/* Alerts */
body.theme-portal .alert{border-radius:12px}
body.theme-portal .alert-error{border-color:rgba(255,100,120,.35);background:rgba(120,20,30,.35);color:#ffb8c0}
body.theme-portal .alert-success{border-color:rgba(80,200,140,.35);background:rgba(20,80,50,.35);color:#b9f2d2}
body.theme-portal .alert-info{border-color:rgba(110,160,255,.35);background:rgba(20,40,80,.35);color:#cfe2ff}

/* Dropdown */
body.theme-portal .dropdown-menu{background:rgba(16,20,27,.98);border:1px solid rgba(120,137,170,.2)}
body.theme-portal .dropdown-menu a{color:#e6eaf2}
body.theme-portal .dropdown-menu a:hover{background:rgba(40,48,62,.8)}

/* Dividers */
body.theme-portal .divider{background:linear-gradient(90deg, rgba(120,137,170,.0), rgba(120,137,170,.35), rgba(120,137,170,.0))}

/* Headings */
body.theme-portal h1, body.theme-portal h2, body.theme-portal h3{letter-spacing:.2px}

/* Subtle animations */
body.theme-portal .card, body.theme-portal .icon-btn, body.theme-portal button, body.theme-portal .btn{transition:transform .06s ease, box-shadow .25s ease, background .25s ease, filter .25s ease}
body.theme-portal .card:hover{transform:translateY(-1px);box-shadow:0 14px 36px rgba(0,0,0,.45)}


/* Service selector UI */
.service-toolbar{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-bottom:8px}
.service-toolbar input{max-width:280px}
.btn-xs{padding:6px 10px;border-radius:8px;font-size:12px}
.service-grid{display:grid;grid-template-columns:repeat(auto-fill, minmax(220px,1fr));gap:10px}
.service-card{display:flex;gap:10px;align-items:flex-start;padding:10px;border:1px solid #e6e6e6;border-radius:12px;background:#fff;cursor:pointer;user-select:none;transition:background .2s, border-color .2s, box-shadow .2s}
.service-card:hover{box-shadow:0 6px 16px rgba(0,0,0,.08)}
.service-card input[type=checkbox]{margin-top:3px}
.service-card.selected{border-color:#0a7cff;box-shadow:0 0 0 4px rgba(10,124,255,.15)}
.svc-icon{width:24px;height:24px;color:#0a7cff;flex:0 0 auto;margin-top:2px}
.svc-info .svc-title{line-height:1.3}
.svc-info .svc-desc{color:#666;font-size:12px;margin-top:2px}

/* Dark theme variants */
body.theme-portal .service-toolbar input{background:#10151c;border:1px solid rgba(120,137,170,.24);color:#e6eaf2}
body.theme-portal .service-card{background:linear-gradient(180deg, rgba(21,26,34,.92), rgba(17,21,28,.92));border:1px solid rgba(120,137,170,.18)}
body.theme-portal .service-card:hover{box-shadow:0 10px 28px rgba(0,0,0,.35)}
body.theme-portal .service-card.selected{border-color:#6aa7ff;box-shadow:0 0 0 4px rgba(80,140,255,.15)}
body.theme-portal .svc-icon{color:#86c5ff}
body.theme-portal .svc-info .svc-desc{color:#9aa3b2}

.btn-danger{border:none;background:#f44336}
/* Toolbar (полоска заголовка с действиями) */
.toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:10px 0; }
.toolbar h1, .toolbar h2 { margin:0; }

/* Таблицы */
.table-scroll { width:100%; overflow:auto; }
.table { width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid #e6e6e6; border-radius:12px; overflow:hidden; }
.table thead th { text-align:left; font-weight:600; font-size:14px; color:#444; background:#f5f7fa; padding:10px 12px; border-bottom:1px solid #e6e6e6; }
.table tbody td { padding:10px 12px; border-bottom:1px solid #eee; vertical-align:top; }
.table tbody tr:hover { background:#fafbfc; }
.table .actions { white-space:nowrap; display: flex; align-items: center; gap:6px;}
.table .actions .icon-btn { margin-right:0px; }


/* Dark theme для таблиц */
body.theme-portal .table { background:linear-gradient(180deg, rgba(21,26,34,.92), rgba(17,21,28,.92)); border:1px solid rgba(120,137,170,.18); }
body.theme-portal .table thead th { color:#dbe4f3; background:rgba(25,31,41,.85); border-bottom:1px solid rgba(120,137,170,.18); }
body.theme-portal .table tbody td { border-bottom:1px solid rgba(120,137,170,.12); }
body.theme-portal .table tbody tr:hover { background:rgba(38,45,58,.35); }

/* Модальные окна (простые, без bootstrap) */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index:1000; }
.modal.open { display:flex; }
.modal-content { width:min(720px, 92vw); background:#fff; border:1px solid #e6e6e6; border-radius:16px; box-shadow:0 20px 50px rgba(0,0,0,.25); overflow:hidden; }
.modal-header, .modal-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; background:#f7f9fc; border-bottom:1px solid #e6e6e6; }
.modal-footer { border-top:1px solid #e6e6e6; border-bottom:none; }
.modal-body { padding:16px; background:#fff; }
.close { border:none; background:transparent; font-size:22px; line-height:1; cursor:pointer; color:#555; }
.close:hover { color:#222; }

/* Dark theme модальные */
body.theme-portal .modal-content { background:linear-gradient(180deg, rgba(21,26,34,.98), rgba(17,21,28,.98)); border:1px solid rgba(120,137,170,.18); box-shadow:0 30px 70px rgba(0,0,0,.5); }
body.theme-portal .modal-header, body.theme-portal .modal-footer { background:rgba(20,26,34,.85); border-color:rgba(120,137,170,.18); }
body.theme-portal .modal-body { background:transparent; }
body.theme-portal .close { color:#c7d3e6; }

/* Сетки форм и колонок */
.form-grid { display:grid; grid-template-columns:1fr; gap:12px; }
@media (min-width: 720px) { .form-grid { grid-template-columns:1fr 1fr; } }
.grid-2 { display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width: 920px) { .grid-2 { grid-template-columns:1fr 1fr; } }

/* Подсказки (data-tooltip) */
[data-tooltip] { position:relative; }
[data-tooltip]:hover::after { content:attr(data-tooltip); position:absolute; left:50%; transform:translateX(-50%); bottom:calc(100% + 8px); white-space:nowrap; background:rgba(20,26,34,.95); color:#e6eaf2; font-size:12px; padding:6px 8px; border-radius:8px; border:1px solid rgba(120,137,170,.25); box-shadow:0 8px 20px rgba(0,0,0,.35); z-index:1001; }
[data-tooltip]:hover::before { content:""; position:absolute; left:50%; transform:translateX(-50%); bottom:100%; border:6px solid transparent; border-top-color:rgba(20,26,34,.95); }

/* Размеры кнопок */
.btn-sm { padding:8px 10px; border-radius:10px; font-size:13px; }

/* Варианты кнопок */
.btn-primary { background:linear-gradient(135deg, #3a7bd5, #3a6073); color:#f7fbff; }
body.theme-portal .btn-primary { background:linear-gradient(135deg, #3a7bd5, #3a6073); }
.btn-outline { background:transparent; color:#0a7cff; border:1px solid currentColor; }
body.theme-portal .btn-outline { color:#86c5ff; border-color:rgba(134,197,255,.7); }


/* Force single-column grid variant */
.form-grid.stack { grid-template-columns: 1fr !important; }

/* Readonly fields slightly lighter */
input[readonly], textarea[readonly], select[readonly] {
  background: #f5f7fa;
  color: #555;
}
/* Dark theme readonly */
body.theme-portal input[readonly],
body.theme-portal textarea[readonly],
body.theme-portal select[readonly] {
  background: #141a22; /* slightly lighter than #10151c */
  border-color: rgba(120,137,170,.28);
  color: #cbd5e1;
}
