:root {
    --ws-black: #111111;
    --ws-white: #ffffff;
    --ws-gray-50: #fafafa;
    --ws-gray-100: #f2f2f2;
    --ws-gray-200: #e4e4e4;
    --ws-gray-400: #a0a0a0;
    --ws-gray-600: #5c5c5c;
    --ws-radius: 10px;
    --ws-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --ws-shadow-hover: 0 6px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--ws-gray-50);
    color: var(--ws-black);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* --- Topbar --- */
.ws-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--ws-white);
    border-bottom: 1px solid var(--ws-gray-200);
    position: sticky;
    top: 0;
    z-index: 20;
}
.ws-topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.02em; }
.ws-logo { height: 28px; width: auto; }
.ws-topbar-nav { display: flex; gap: 24px; font-size: 14px; font-weight: 500; }
.ws-topbar-nav a { color: var(--ws-gray-600); transition: color .15s; }
.ws-topbar-nav a:hover { color: var(--ws-black); }
.ws-topbar-user { display: flex; align-items: center; gap: 14px; font-size: 14px; }

/* --- Layout --- */
.ws-main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.ws-page-header { margin-bottom: 28px; }
.ws-page-header h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.ws-page-header p { color: var(--ws-gray-600); margin: 0; font-size: 14px; }

.ws-grid { display: grid; gap: 20px; }
.ws-grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ws-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .ws-grid-2 { grid-template-columns: 1fr; } }

/* --- Cards --- */
.ws-card {
    background: var(--ws-white);
    border: 1px solid var(--ws-gray-200);
    border-radius: var(--ws-radius);
    box-shadow: var(--ws-shadow);
    padding: 20px;
    transition: box-shadow .18s, transform .18s;
}
.ws-card-app { display: flex; flex-direction: column; gap: 14px; }
.ws-card-app:hover { box-shadow: var(--ws-shadow-hover); transform: translateY(-2px); }
.ws-app-icon {
    width: 42px; height: 42px; border-radius: 9px;
    background: var(--ws-black); color: var(--ws-white);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
}
.ws-card-app h3 { margin: 0; font-size: 16px; }
.ws-card-app p { margin: 0; font-size: 13px; color: var(--ws-gray-600); flex: 1; }

/* --- Buttons --- */
.ws-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: 7px; font-size: 14px; font-weight: 600;
    border: 1px solid var(--ws-black); cursor: pointer; transition: all .15s;
}
.ws-btn-primary { background: var(--ws-black); color: var(--ws-white); }
.ws-btn-primary:hover { background: #000; }
.ws-btn-ghost { background: transparent; border-color: var(--ws-gray-200); color: var(--ws-gray-600); }
.ws-btn-ghost:hover { border-color: var(--ws-black); color: var(--ws-black); }
.ws-btn-block { width: 100%; }
.ws-btn-sm { padding: 5px 10px; font-size: 12px; }

/* --- Forms --- */
.ws-field { margin-bottom: 16px; }
.ws-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ws-input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--ws-gray-200);
    border-radius: 7px; font-size: 14px; background: var(--ws-white);
}
.ws-input:focus { outline: none; border-color: var(--ws-black); }

/* --- Login screen --- */
.ws-auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--ws-gray-50);
}
.ws-auth-box {
    width: 100%; max-width: 380px; background: var(--ws-white);
    border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius);
    box-shadow: var(--ws-shadow); padding: 36px 32px;
}
.ws-auth-logo { text-align: center; margin-bottom: 24px; }
.ws-auth-logo img { height: 46px; }
.ws-auth-box h1 { font-size: 18px; text-align: center; margin: 0 0 24px; font-weight: 600; }
.ws-error { background: #fdecec; color: #a10e0e; border: 1px solid #f3c1c1; border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.ws-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--ws-gray-400); font-size: 12px; }
.ws-divider::before, .ws-divider::after { content: ''; flex: 1; height: 1px; background: var(--ws-gray-200); }

/* --- Widgets --- */
.ws-widget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ws-widget-header h2 { font-size: 15px; margin: 0; }
.ws-todo-item, .ws-shortcut-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ws-gray-100); font-size: 14px; }
.ws-todo-item:last-child, .ws-shortcut-item:last-child { border-bottom: none; }
.ws-todo-item.done span { text-decoration: line-through; color: var(--ws-gray-400); }

.ws-notes-board { position: relative; min-height: 320px; }
.ws-note {
    position: absolute; border-radius: 8px; padding: 12px; font-size: 13px;
    box-shadow: var(--ws-shadow); border: 1px solid rgba(0,0,0,0.06);
    display: flex; flex-direction: column; gap: 6px; overflow: auto;
}
.ws-note textarea { border: none; background: transparent; resize: none; width: 100%; height: 100%; font: inherit; }

/* --- Tables (admin) --- */
.ws-table { width: 100%; border-collapse: collapse; background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius); overflow: hidden; }
.ws-table th, .ws-table td { text-align: left; padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--ws-gray-100); }
.ws-table th { background: var(--ws-gray-50); font-weight: 600; color: var(--ws-gray-600); }
.ws-table tr:last-child td { border-bottom: none; }
.ws-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.ws-badge-ok { background: #e7f6ec; color: #147a3d; }
.ws-badge-off { background: #f2f2f2; color: #777; }

.ws-admin-nav { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.ws-admin-nav a { padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ws-gray-600); }
.ws-admin-nav a.active, .ws-admin-nav a:hover { background: var(--ws-black); color: var(--ws-white); }
