@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  a {
    @apply text-purple-500 text-sm;
  }
  fieldset {
    @apply border bg-white;
  }
  fieldset legend {
    @apply px-1 font-semibold text-gray-500;
  }
}
@layer components {
  [type="checkbox"]:focus,
  [type="radio"]:focus,
  [type="checkbox"]:hover,
  [type="radio"]:hover {
    --tw-ring-color: purple;
    color: purple;
  }
  .dark [type="checkbox"]:checked,
  .dark [type="radio"]:checked,
  [type="checkbox"]:checked,
  [type="radio"]:checked {
    @apply bg-purple-500;
  }
  h1.title {
    @apply text-2xl text-gray-700;
  }
  .head1 {
    @apply text-2xl text-gray-700 py-5;
  }
  .head2 {
    @apply text-lg text-gray-600;
  }
  .head3 {
    @apply text-gray-500 text-base font-bold;
  }
  ul.menu {
    @apply h-full;
  }
  ul.menu > li {
    @apply h-full inline-block;
  }
  ul.menu > li > a {
    @apply h-full flex items-center justify-center px-4 cursor-pointer;
  }
  ul.menu > li:hover {
    @apply bg-slate-50;
  }
  ul.menu > li button {
    @apply text-purple-600 font-normal p-0 m-0 bg-none hover:bg-transparent;
  }
  table {
    @apply w-full text-sm text-left text-gray-500 border;
  }
  table thead {
    @apply text-xs text-gray-700 uppercase bg-gray-50 dark:text-gray-400 border-b border-t font-semibold;
  }
  table thead tr th {
    @apply bg-gray-100;
  }
  table thead tr th a {
    @apply text-xs font-semibold;
  }
  table tbody tr:nth-child(2n + 1) {
    @apply bg-white border-b;
  }
  table tbody tr:nth-child(2n) {
    @apply border-b bg-gray-50;
  }
  table tfoot {
    @apply text-xs text-gray-700 uppercase bg-gray-50 dark:text-gray-400 border-t font-semibold;
  }
  table tr th,
  table tr td {
    @apply p-2;
  }
  /* simple_form */
  .simple_form {
    @apply bg-white shadow rounded border p-4;
  }
  .simple_form .header {
    @apply text-gray-700 text-sm font-medium -ml-4 -mr-4 -mt-4 px-4 py-2 border-b border-gray-200 flex justify-between items-center;
  }
  .simple_form .input {
    @apply py-2;
  }
  .simple_form .input label {
    @apply block text-gray-900 text-sm mb-1;
  }
  .simple_form .input .hint {
    @apply text-gray-400 text-xs italic;
  }
  .simple_form .input input:not(.radio_buttons):not(.boolean),
  .simple_form .input select {
    @apply block w-full p-2 text-gray-900 border border-gray-300 rounded bg-gray-50 sm:text-xs focus:ring-purple-500 focus:border-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-purple-500 dark:focus:border-purple-500;
  }
  .simple_form .input input.boolean {
    @apply mr-2;
  }
  .simple_form.floating {
    @apply bg-gray-50 border border-gray-200 shadow-none rounded px-2 pt-4 pb-2;
  }
  .simple_form.floating .input {
    @apply p-0 relative;
  }
  .simple_form.floating .input:not(.boolean) label {
    @apply leading-4 absolute -top-2 left-1 text-xs font-semibold text-gray-500 bg-white;
  }
  .simple_form .input textarea {
    @apply px-3 py-2 text-xs border-gray-300 min-h-[80px] rounded focus:ring-1 focus:outline-none focus:ring-purple-500 dark:focus:ring-purple-800 h-10 w-full;
  }
  /* @apply px-3 py-2 text-xs font-medium text-center text-white bg-purple-500 rounded hover:bg-purple-700 focus:ring-4 focus:outline-none focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800; */

  /* button */
  button,
  input[type="submit"],
  .btn-primary {
    @apply px-3 py-2 text-xs font-medium text-center text-white bg-purple-500 rounded hover:bg-purple-700 focus:ring-4 focus:outline-none focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800;
  }
  .btns-inline {
    @apply inline-flex;
  }
  .btns-inline [class*="btn-"] {
    @apply rounded-none;
  }
  .btns-inline [class*="btn-"]:first-child {
    @apply rounded-l;
  }
  .btns-inline [class*="btn-"]:last-child {
    @apply rounded-r;
  }
  .btns-inline [class*="btn-"]:not(:first-child) {
    @apply border-l;
  }
  /* card */
  .card {
    @apply flex flex-col bg-white shadow-sm p-4 space-y-2 border;
  }
  .card > .header {
    @apply text-gray-700 text-sm font-medium -ml-4 -mr-4 -mt-4 px-4 py-1 border-b border-gray-200 flex justify-between items-center;
  }
  .card h3 {
    @apply text-gray-500 text-base font-bold mb-1;
  }
  .card .item {
    @apply flex flex-row space-x-3;
  }
  .card .action {
    @apply flex flex-row space-x-2 text-purple-500;
  }
  .dropdown {
    @apply inline-block relative;
  }
  .dropdown .dropdown-menu {
    @apply absolute hidden pt-1 rounded;
  }
  .dropdown:hover .dropdown-menu {
    display: block;
  }
  .card-inline {
    @apply flex flex-row w-full items-center border border-gray-300 bg-white shadow p-0 mb-2 space-x-2;
  }
  .error {
    @apply text-red-400;
  }
  .flash {
    @apply fixed top-0 left-1/2 -translate-x-1/2 flex flex-col items-center gap-3 max-w-full w-max p-1;
  }
  .flash-message {
    @apply animate-fade-out w-max text-sm text-white p-2 bg-purple-600 rounded;
  }
  .uninvoiced {
    @apply w-24 inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/10;
  }
  .invoiced {
    @apply w-24 inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20;
  }
  main {
    @apply h-screen flex flex-col bg-gray-100 p-4 sm:ml-64;
  }
  main > .header {
    @apply grow-0 text-lg text-gray-700 font-medium -mx-4 -mt-4 mb-4 px-4 py-2.5 border-b border-gray-200 flex justify-between items-center;
    height: 49px;
  }
  main .content {
    @apply grow overflow-auto;
  }
}
/* https://ddnexus.github.io/pagy/docs/api/stylesheets/ */
.pagy {
  display: flex;
  font-family: sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: #6b7280;
  margin: 12px 0;
}
.pagy > :not([hidden]) ~ :not([hidden]) {
  --space-reverse: 0;
  margin-right: calc(0.25rem * var(--space-reverse));
  margin-left: calc(0.25rem * calc(1 - var(--space-reverse)));
}
.pagy a:not(.gap) {
  display: block;
  text-decoration: none;
  border-radius: 0.5rem;
  background-color: #e5e7eb;
  padding: 0.25rem 0.75rem;
  color: inherit;
}
.pagy a:not(.gap):hover {
  background-color: #fae8ff;
}
.pagy a:not(.gap):not([href]) { /* disabled links */
  cursor: default;
  background-color: #f3f4f6;
  color: #d1d5db;
}
.pagy a:not(.gap).current {
  background-color: #9ca3af;
  color: white;
}
.pagy label {
  white-space: nowrap;
  display: inline-block;
  border-radius: 0.5rem;
  background-color: #e5e7eb;
  padding: 0.125rem 0.75rem;
}
.pagy label input {
  line-height: 1.5rem;
  border-radius: 0.375rem;
  border-style: none;
  background-color: #f3f4f6;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
